文件名称:Unixftpcilent
介绍说明--下载内容均来自于网络,请自行研究使用
一个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 scr ipt, 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
之所以封装这个类是因为以前在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 scr ipt, 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
(系统自动生成,下载前可以参看下载内容)
下载文件列表
FTPTools
........\FTPTools.cc
........\FTPTools.h
........\FTPTools.cc
........\FTPTools.h