CFtpConnection* m_pFtpConnection;
CInternetSession* m_pInetSession = new CInternetSession( AfxGetAppName(), 1,
PRE_CONFIG_INTERNET_ACCESS);
try{
m_pFtpConnection = m_pInetSession->
GetFtpConnection(L"10.71.122.136", L"penghui", L"penghui", 21);
BOOL ret = m_pFtpConnection->GetFile(L"readme.txt", L"D:\\learn\\ftp\\Debug\\readme.txt", FALSE);
DWORD dErr = GetLastError() ;
m_pFtpConnection->Close();
m_pInetSession->Close();
}
//若登陆不成功则抛出异常,以下是针对异常的处理
catch(CInternetException *pEx){
printf("0000");
}