MFC中如何获得FTPES类型服务器的内容
使用MFC查找FTPES模式FTP服务器的内容再下载,这是要怎么做了,或者用filezalli软件能否实现?
求大神高见!
------解决思路----------------------
MFC里有对FTP的支持,查查MSDN里面有些例子
下面是查找文件的例子
CInternetSession sess(_T("My FTP Session"));
CFtpConnection* pConnect = NULL;
try
{
// Request a connection to ftp.microsoft.com. Default
// parameters mean that we'll try with username = ANONYMOUS
// and password set to the machine name @ domain name
pConnect = sess.GetFtpConnection(_T("ftp.microsoft.com"));
// use a file find object to enumerate files
CFtpFileFind finder(pConnect);
// start looping
BOOL bWorking = finder.FindFile(_T("*"));
while (bWorking)
{
bWorking = finder.FindNextFile();
_tprintf_s(_T("%s\n"), (LPCTSTR)finder.GetFileURL());
}
}
catch (CInternetException* pEx)
{
TCHAR sz[1024];
pEx->GetErrorMessage(sz, 1024);
_tprintf_s(_T("ERROR! %s\n"), sz);
pEx->Delete();
}
// if the connection is open, close it
if (pConnect != NULL)
{
pConnect->Close();
delete pConnect;
}