Skip to content

Latest commit

 

History

History
99 lines (73 loc) · 3.17 KB

InternetConnect.md

File metadata and controls

99 lines (73 loc) · 3.17 KB

Home

Function name : InternetConnect

Group: Internet Functions (WinInet) - Library: wininet


Opens an FTP, Gopher, or HTTP session for a given site


Code examples:

How to download a file from the FTP server using FtpGetFile
Retrieving list of files on the FTP directory
Creating a directory on the FTP
Using FtpCommand
Reading Internet Query options
Uploading local file to FTP server with FtpPutFile
Uploading file to the FTP server using InternetWriteFile
Downloading files from the FTP server using InternetReadFile
How to retrieve the size of a remote file (FTP)
How to remove FTP directory
How to delete file on FTP server
Custom HttpRequest class (WinINet)
Reading list of folders and files on FTP server
Custom FTP Class for Visual FoxPro application

Declaration:

HINTERNET InternetConnect(
    HINTERNET hInternet,
    LPCTSTR lpszServerName,
    INTERNET_PORT nServerPort,
    LPCTSTR lpszUsername,
    LPCTSTR lpszPassword,
    DWORD dwService,
    DWORD dwFlags,
    DWORD_PTR dwContext
);
  

FoxPro declaration:

DECLARE INTEGER InternetConnect IN wininet;
	INTEGER hInternetSession,;
	STRING  sServerName,;
	INTEGER nServerPort,;
	STRING  sUsername,;
	STRING  sPassword,;
	INTEGER lService,;
	INTEGER lFlags,;
	INTEGER lContext
  

Parameters:

hInternet [in] Valid HINTERNET handle returned by a previous call to InternetOpen.

lpszServerName [in] Pointer to a null-terminated string that contains the host name of an Internet server.

nServerPort [in] longof the TCP/IP port on the server to connect to. These flags set only the port that will be used.

lpszUsername [in] Pointer to a null-terminated string that contains the name of the user to log on.

lpszPassword [in] Pointer to a null-terminated string that contains the password to use to log on.

dwService [in] Unsigned long integer value that contains the type of service to access.

dwFlags [in] Unsigned long integer value that contains the flags specific to the service used.

dwContext [in] Pointer to an unsigned long integer value ...


Return value:

Returns a valid handle to the FTP, Gopher, or HTTP session if the connection is successful, or NULL otherwise


Comments:

Some main FTP functions can be implemented in Visual Foxpro through creating command files and running FTP.EXE utility as an external application. This program is usually installed on Windows computers as a regular part of the OS.

Nevertheless when using the Inet functions you may acquire more control comparing to the FTP.EXE option.