因cache缓冲问题,之前最近时间下载过,远端文件修改后在下载下载不到最新文件,在FLAG中加入属性INTERNET_FLAG_RELOAD(强制从远端下载)即可,具体如下:
MSDN原文 相关部分已加红
FtpGetFile Function
Retrieves a file from the FTP server and stores it under the specified file name, creating a new local file in the process.
Syntax
BOOL FtpGetFile(
HINTERNET hConnect,
LPCTSTR lpszRemoteFile,
LPCTSTR lpszNewFile,
BOOL fFailIfExists,
DWORD dwFlagsAndAttributes,
DWORD dwFlags,
DWORD_PTR dwContext
);
Parameters
hConnect
- [in] Valid handle to an FTP session.
lpszRemoteFile- [in] Pointer to a null-terminated string that contains the name of the file to retrieve from the remote system.
lpszNewFile- [in] Pointer to a null-terminated string that contains the name of the file to create on the local system.
fFailIfExists- [in] BOOL<