Code:time_t t1=time(NULL); HINTERNET hSession = InternetOpen(0, INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, 0); HINTERNET hService = InternetConnect(hSession, server, INTERNET_DEFAULT_FTP_PORT, user, pass, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0); FtpSetCurrentDirectory(hService, path); FtpPutFile(hService, szLocalFile, szRemoteFile, FTP_TRANSFER_TYPE_ASCII, 0); if(FtpGetFile(hService, mR, mL, false, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_BINARY, 0)) {cout<<"true"<<"\n";} else {cout<<GetLastError();} InternetCloseHandle(hService); InternetCloseHandle(hSession); time_t t2=time(NULL); time_t t3=t2-t1;


Reply With Quote