Group: Internet Functions (WinInet) - Library: wininet
Retrieving list of files on the FTP directory
Downloading files from the FTP server using InternetReadFile
Reading list of folders and files on FTP server
Custom FTP Class for Visual FoxPro application
HINTERNET FtpFindFirstFile(
HINTERNET hConnect,
LPCTSTR lpszSearchFile,
LP lpFindFileData,
DWORD dwFlags,
DWORD_PTR dwContext
);
DECLARE INTEGER FtpFindFirstFile IN wininet;
INTEGER hFtpSession,;
STRING lpszSearchFile,;
STRING @ lpFindFileData,;
INTEGER dwFlags,;
INTEGER dwContent
hConnect [in] Valid handle to an FTP session returned from InternetConnect
lpszSearchFile [in] Pointer to a null-terminated string that specifies a valid directory path or file name for the FTP server"s file system
lpFindFileData [out] Pointer to a WIN32_FIND_DATA structure that receives information about the found file or directory
dwFlags [in] Value of type DWORD that specifies the flags that control the behavior of this function
dwContext [in] Pointer to a variable of type DWORD that specifies the application-defined value...
Returns a valid handle for the request if the directory enumeration was started successfully, or returns NULL otherwise
The old and familiar approach -- to get a handle from the FindFirst call and use it with successive FindNext calls. The trick -- though simple enough - is how to retrieve fields from a structure containing in the resulting buffer.