Description: 一个FTP客户端类,用Socket写的,环境为Unix。
之所以封装这个类是因为以前在unix下写文件上传下载的操作都是调shell脚本,C、C++很难控制与shell的交互,
并且无法获知出错的错误代码,用C++封装成一个工具类后,任何项目都可以重用了。
操作很方便,就像平常的FTP操作:
1:登陆FTP服务端
FTPTools ftpTools (conts string &pm_sFtpServer,int pm_iFtpPort)
ftpTools.login(conts string &pm_sFtpUser,const string &pm_sFtpPwd)
2:进入服务端目录
ftpTools.cd(const string & pm_sServerPath)
3:设定本地目录
ftpTools.Lcd(const string & pm_sLocalPath)
4:上传文件
ftpTools.upload(const string &pm_sSrcFilePath,const string & pm_sSrcFileName)
5:下载文件
ftpTools.download(const string & pm_sServerFileName,const string & pm_sDesPath)
支持全路径文件名,PASV模式
-an FTP client category, Socket written in the Unix environment. The reason Packaging category is because the written document under unix uploading and downloading operations are transferred to the shell script, C, C + + is difficult to control and the interactive shell, and not informed of the error code error, Using C + + tools packaged as a category, any item can reuse of. Easy to operate, just like normal FTP : 1 : landing FTP server FTPTools ftpTools (Contracting string Platform: |
Size: 4704 |
Author:sl |
Hits:
Description: 一个FTP客户端类,用Socket写的,环境为Unix。
之所以封装这个类是因为以前在unix下写文件上传下载的操作都是调shell脚本,C、C++很难控制与shell的交互,
并且无法获知出错的错误代码,用C++封装成一个工具类后,任何项目都可以重用了。
操作很方便,就像平常的FTP操作:
1:登陆FTP服务端
FTPTools ftpTools (conts string &pm_sFtpServer,int pm_iFtpPort)
ftpTools.login(conts string &pm_sFtpUser,const string &pm_sFtpPwd)
2:进入服务端目录
ftpTools.cd(const string & pm_sServerPath)
3:设定本地目录
ftpTools.Lcd(const string & pm_sLocalPath)
4:上传文件
ftpTools.upload(const string &pm_sSrcFilePath,const string & pm_sSrcFileName)
5:下载文件
ftpTools.download(const string & pm_sServerFileName,const string & pm_sDesPath)
支持全路径文件名,PASV模式
-an FTP client category, Socket written in the Unix environment. The reason Packaging category is because the written document under unix uploading and downloading operations are transferred to the shell script, C, C++ is difficult to control and the interactive shell, and not informed of the error code error, Using C++ tools packaged as a category, any item can reuse of. Easy to operate, just like normal FTP : 1 : landing FTP server FTPTools ftpTools (Contracting string Platform: |
Size: 4096 |
Author:sl |
Hits:
Description: shell脚本包,包含自动上传压缩包到ftp服务器上。通常用于日志之类的定时备份;定时把信息写入mysql数据库;定时备份定时备份apache日志等-shell script package that contains compressed packages automatically upload to the ftp server. Often used like regular log backup regularly put information write mysql database regular backup regularly backup apache logs, etc. Platform: |
Size: 2048 |
Author:潘峰 |
Hits: