#pragma once #include #include #include #include #ifdef _WIN32 #include #include #include //链接wininet.lib库 #pragma comment(lib,"wininet.lib") #else #include #include #include #include #include #endif // _WIN32 class FtpServer { public: FtpServer(); ~FtpServer(); // ftp 文件上传 int FtpUpload(const char* ip, const char* localPathName, const char* uploadPath); int FtpDownload(const char* ip, const char* LocalPath, const char* LocalName, const char* downPath); int FtpGetFileList(const char* ip, const char* filePath, std::vector* fileNames); private: int FtpUploadWin(const char* ip, const char* localPathName, const char* uploadPathName); int FtpDownloadWin(const char* ip, const char* LocalPathName, const char* downPathName); int FtpGetFileListWin(const char* ip, const char* filePath, std::vector* fileNames); int FtpUploadLin(const char* ip, const char* localPathName, const char* uploadPathName); int FtpDownloadLin(const char* ip, const char* LocalPathName, const char* downPathName); int FtpGetFileListLin(const char* ip, const char* filePath, std::vector* fileNames); private: int ftpServerProt_m_; char* ftpUserName_m_; char* ftpUserPwd_m_; #ifdef _WIN32 char* szAppname_m_; char* szUsername_m_; char* szPassword_m_; #else #endif // _WIN32 };