U
Wir sind hier bei MFC.
#include <afxinet.h>
CInternetSession* m_pInetSession;
CString str;
if (!str.LoadString(1)) str = _T("AppUnknown");
m_pInetSession = new CInternetSession(str, 1, PRE_CONFIG_INTERNET_ACCESS);
CFtpConnection* m_pFtpConnection;
INTERNET_PORT nPort=21;
try
{
m_pFtpConnection = m_pInetSession->GetFtpConnection("system","UID","PWD",nPort,FALSE);
}
catch (CInternetException* pEx)
{
TCHAR szErr[1024];
if (pEx->GetErrorMessage(szErr, 1024))
AfxMessageBox(szErr, MB_OK);
else
AfxMessageBox("Error Connection", MB_OK);
pEx->Delete();
return 0;
}
Nur als Bsp.