Skip to content

Latest commit

 

History

History
71 lines (50 loc) · 2.02 KB

FtpFindFirstFile.md

File metadata and controls

71 lines (50 loc) · 2.02 KB

Home

Function name : FtpFindFirstFile

Group: Internet Functions (WinInet) - Library: wininet


Searches the specified directory of the given FTP session


Code examples:

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

Declaration:

HINTERNET FtpFindFirstFile(
    HINTERNET hConnect,
    LPCTSTR lpszSearchFile,
    LP lpFindFileData,
    DWORD dwFlags,
    DWORD_PTR dwContext
);
  

FoxPro declaration:

DECLARE INTEGER FtpFindFirstFile IN wininet;
	INTEGER  hFtpSession,;
	STRING   lpszSearchFile,;
	STRING @ lpFindFileData,;
	INTEGER  dwFlags,;
	INTEGER  dwContent  

Parameters:

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...


Return value:

Returns a valid handle for the request if the directory enumeration was started successfully, or returns NULL otherwise


Comments:

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.