资源介绍
跨平台的C++FTP客户端源码
class ftpclient
{
public:
ftpclient(const char* connmode="port", const char* transmode="binary");
~ftpclient(void);
int connect(const char* addr, short port);
int disconnect();
int login(const char* username, const char* passwd);
int get(const char* remotefile, const char* localfile);
int put(const char* localfile, const char* remotefile);
int gets(const char* remotedir, const char* localdir);
int puts(const char* localdir, const char* remotedir);
int dir(const char* remotedir, vector& result);
int ldir(const char* localdir, vector& result);
int PWD(char* remotedir);
int CD(const char* remotedir);
int MKDIR(const char* remotedir);
int SIZE(const char* remotefile, int& length);
protected:
int ASCII();
int BINARY();
int PASV(char* addr, short& port);
int PORT(const char* addr, short port);
int LIST(const char* remotedir);
int RETR(const char* remotefile);
int STOR(const char* remotefile);
int serversock(SOCKET& sock, const char* addr, short port);
int datasock(SOCKET& sock, const char* addr, short port);
//command
private:
SOCKET controlsock_;
char connmode_[8];
char transmode_[8];
};
- 上一篇: ftp客户端源码
- 下一篇: FTP上传下载C++实现