#include "FtpDlg.h"
typedef struct
{
CListBox* pList;
CString strFtpSite;
CString strName;
CString strPwd;
}FTP_INFO;
UINT ListContentMT(LPVOID pParam)
{
if (pParam==NULL)
AfxEndThread(NULL);
//获得参数
FTP_INFO* pInfo;
CListBox* pList;
CString strFtpSite;
CString strName;
CString strPwd;
pInfo=(FTP_INFO*)pParam;
pList=pInfo->pList;
strFtpSite=pInfo->strFtpSite;
strName=pInfo->strName;
strPwd=pInfo->strPwd;
CInternetSession* pSession;
CFtpConnection* pConnection;
CFtpFileFind* pFileFind;
CString strFileName;
BOOL bContinue;
pConnection=NULL;
pFileFind=NULL;
//创建Internet会话
pSession=new CInternetSession(AfxGetAppName(),1,PRE_CONFIG_INTERNET_ACCESS);
try
{
//试图建立FTP连接
pConnection=pSession->GetFtpConnection(strFtpSite,strName,strPwd);
}
catch(CInternetException* e)
{
//错误处理
e->Delete();
pConnection=NULL;
}
if (pConnection!=NULL)
{
//创建CF
VC FTP多线程上传下载
最新推荐文章于 2020-03-20 14:37:19 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)