(资料图片)
大家好,现在来为大家解答以上的问题。hinterland翻译,hinternet这个很多人还不知道,现在让我们一起来看看吧!
1、给你个例子#include void main(){ BOOL dRes,pRes; HINTERNET hInternet; HINTERNET hConnect; hInternet = InternetOpen("A3GS Sample", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, INTERNET_FLAG_NO_CACHE_WRITE); if ( NULL == hInternet ) { printf("InternetOpen Error:%d", GetLastError() ); } hConnect = InternetConnect(hInternet, "127.0.0.1", INTERNET_DEFAULT_FTP_PORT, "ww123", "12345", INTERNET_SERVICE_FTP, INTERNET_FLAG_EXISTING_CONNECT || INTERNET_FLAG_PASSIVE,0 ); if ( NULL == hInternet ) { printf( "InternetConnect Error:%d", GetLastError() ); InternetCloseHandle(hInternet); }dRes = FtpGetFile(hConnect, "./wwyy/download/test1.txt", "D:\BT\test1.txt", FALSE, FILE_ATTRIBUTE_ARCHIVE, FTP_TRANSFER_TYPE_UNKNOWN, 0); if ( dRes == 0 ) { printf( "FtpGetFile Error:", GetLastError() ); }else{ printf( "下载文件成功!" ); } pRes = FtpPutFile(hConnect,"D:\BT\hhsj.txt","hhsj.txt",FTP_TRANSFER_TYPE_ASCII,0); if(pRes==0) { printf("上传文件失败!"); }else{ printf("上传文件成功!"); } InternetCloseHandle(hConnect); InternetCloseHandle(hInternet); if(dRes&&pRes) return true; else return false;。
本文到此分享完毕,希望对大家有所帮助。
关键词:
责任编辑:Rex_14