//FTP:
//首先电脑要装IIS服务(internet information service),然后共享指定文件夹,设为默认FTP服务器
//上传到服务器指定目录
CInternetSession *internetSession=NULL;
internetSession=new CInternetSession(AfxGetAppName(),1,PRE_CONFIG_INTERNET_ACCESS);
CFtpConnection * ftpConnection = NULL;
ftpConnection=internetSession->GetFtpConnection(“192.168.0.2”,NULL,NULL,21,TRUE);
CString strDesPath = “./” +theApp.m_strAEIFileFullPath.Mid(theApp.m_strAEIFileFullPath.Find("_") - 2);
BOOL b=ftpConnection->PutFile(theApp.m_strAEIFileFullPath,strDesPath,FALSE);
internetSession->Close();
盘符映射:
//先做盘符映射,之后想操作自己电脑一样复制文件
CopyFile(stsrc,strDest,false);
本文介绍通过C++使用IIS服务进行FTP文件上传的方法,包括创建CInternetSession会话、获取CFtpConnection连接及上传文件的步骤。同时,文章也提及了通过盘符映射实现文件复制的便捷方式。
1617

被折叠的 条评论
为什么被折叠?



