VC++ commonly used functions package code a series of articles and source code (advertisement, haha, look at the series and then decide whether to subscribe)
https://blog.csdn.net/kaizi318/article/details/108846326
The source code demo has been uploaded to the Baidu network disk: permanent effective, the code realizes the function of downloading all files in the specified directory of the FTP server
There are many ways to implement FTP download function: CURL (generally it should be used by more people) and the function is also more powerful
also under windows
HINTERNET hint;
HINTERNET hftp;
hint = InternetOpen(0, INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, 0);
if (hint==NULL)
{
break;
}
//Create ftp connection
hftp = InternetConnect(hint, ftpSvrIp.c_str(),port,userName.c_str(),password.c_str(), INTERNET_SERVICE_FTP, 0, 0);
if (hftp==NULL)
{
break;
}
I use this tool to directly call ftp.exe,
Generate a batch script, which is directly convenient for you to run under cmd,
In reality, as long as the script is normal, you don't need to care too much about the code, haha, this is a lazy thing!
After all, I don’t want to write code, I want to write so much, and I need to debug over and over again, and this only needs