#include <afxsock.h>
#include <afxinet.h>
if (!AfxSocketInit())
{
AfxMessageBox("ƒ\ƒPƒbƒg‰Šú‰»Ž¸”s");
return FALSE;
}
CInternetSession *pSession = new CInternetSession();
if(pSession != NULL) {
CFtpConnection *pFTP = NULL;
TRY {
pFTP = pSession->GetFtpConnection(m_Server, m_Name, m_Pass);
} CATCH(CInternetException, e) {
MessageBox("Ú‘±Ž¸”s");
} END_CATCH
if(pFTP) {
if(!pFTP->GetFile(m_Remote, m_Local)) {
MessageBox("ƒ_ƒEƒ“ƒ[ƒhޏ”s");
}
pFTP->Close();
}
delete pFTP;
pSession->Close();
}
delete pSession;
|