18,356
社区成员
发帖
与我相关
我的任务
分享
在一个线城函数中调用下面这段
CInternetSession cis;
cis.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 3000);
CString m_strServer, m_strObject;
INTERNET_PORT nPort;
DWORD dwServerType;
CString strURL(_T("ftp://am:am@ftp.66ys.cn:10168/[66影视www.66ys.cn]阿明.rmvb" ) );
AfxParseURL(strURL,dwServerType,m_strServer,m_strObject, nPort);
CFtpConnection * pFtp = NULL;
try
{
// pFtp=cis.GetFtpConnection(_T("ftp.66ys.cn"), _T("am"),_T("am"),m_dwPort);
pFtp=cis.GetFtpConnection(m_strServer,_T("am"),_T("am"),m_dwPort);
}
catch (CInternetException* excep )
{
// 程序运行到这里就异常了
DWORD dwErrorCode = excep->m_dwError;
CString szError;
szError.Format(
_T("Connect Ftp server failed,the error code is:%d"),dwErrorCode);
AfxMessageBox(szError);
excep->Delete();
return;
}
// 为什么会异常啊,是什么原因, ErrorCode 12029