void CTest2Dlg::OnBnClickedButton51()
{
CInternetSession *pCInternetSession = new CInternetSession();
CFtpConnection *pCFtpConnection = pCInternetSession->GetFtpConnection("58.249.123.236", "lzd", "lzd1234", 21);
CFtpFileFind *pCFtpFileFind = new CFtpFileFind(pCFtpConnection);
//upload file
BOOL bResult = pCFtpConnection->PutFile("D:\\ftpFile.txt", "ftpTest\\ftpFile.txt");
if(bResult)
{
bResult = DeleteFile("D:\\ftpFile.txt");
if(bResult)
{
//download file
bResult = pCFtpConnection->GetFile("ftpTest\\ftpFile.txt", "D:\\ftpFile.txt");
}
}
//find all the file on the ftp server
bResult = pCFtpFileFind->FindFile("*");
while(bResult)
{
bResult = pCFtpFileFind->FindNextFileA();
CString strFileURL = pCFtpFileFind->GetFileURL();
CString strFileName = pCFtpFileFind->GetFileName();
CString strFileTitle = pCFtpFileFind->GetFileTitle();
CString strFilePath = pCFtpFileFind->GetFilePath();
}
//DWORD dTemp = GetLastError();
}