win32inet.InternetConnect

InternetConnect(Internet, ServerName, ServerPort, Username, Password, Service, Flags, Context)

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

Parameters

Internet : PyHINTERNET

Valid HINTERNET handle returned by a previous call to win32inet::InternetOpen.

ServerName : string

A string that contains the host name of an Internet server. Alternately, the string can contain the IP number of the site, in ASCII dotted-decimal format (for example, 11.0.1.45).

ServerPort : int

Number of the TCP/IP port on the server to connect to. These flags set only the port that will be used. The service is set by the value of dwService. This can be one of the INTERNET_DEFAULT_*_PORT constants or INTERNET_INVALID_PORT_NUMBER, which uses the default port for the service specified by dwService.

Username : string

A string that contains the name of the user to log on. If this parameter is None, the function uses an appropriate default, except for HTTP; a NULL parameter in HTTP causes the server to return an error. For the FTP protocol, the default is "anonymous".

Password : string

Address of a null-terminated string that contains the password to use to log on. If both Password and Username are None, the function uses the default "anonymous" password. In the case of FTP, the default password is the user's e-mail name. If lpszPassword is None, but lpszUsername is not None, the function uses a blank password.

Service : int

Iinteger value that contains the type of service to access. This can be one of INTERNET_SERVICE_FTP, INTERNET_SERVICE_GOPHER, or INTERNET_SERVICE_HTTP.

Flags : int

Integer value that contains the flags specific to the service used. When the value of dwService is INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE causes the application to use passive FTP semantics.

Context=None : object

Arbitrary object to be passed to callback function

Comments

Accepts keyword args