Please enable JavaScript to view this site.

thinBasic Help Manual

Navigation: ThinBASIC Modules > INet

INET_Internet_OpenUrl

Scroll Prev Top Next More

* * HELP & MANUAL PREMIUM PACK 4 DEMO VERSION * *

This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.

This version is copyright and may only be used for local testing purposes. It may not be distributed.

Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.

 

Description

 

Opens a resource specified by a complete FTP or HTTP URL.

 

Syntax

 

hInternet = INET_Internet_OpenUrl(hInternet, sUrl , sHeader, dwFlags, dwContext)

 

Returns

 

Returns a valid handle to the URL if the connection is successfully established.

If function fails, it returns %NULL.

 

Parameters

 

Name

Type

Optional

Meaning

hInternet

Number

No

The handle to the current Internet session. The handle must have been returned by a previous call to INET_Internet_Open.

sUrl

String

No

String that specifies the URL to begin reading.

Only URLs beginning with ftp:, http:, or https: are supported.

sHeader

String

No

String that specifies the headers to be sent to the HTTP server

dwFlags

Number

No

Options. This parameter can be a combination multiple values. See INET Equates for the list of possible values.

dwContext

Number

No

A numeric value that specifies an application-defined value that is passed, along with the returned handle, to any callback functions.

 

Remarks

 

This is a general function that an application can use to retrieve data over any of the protocols that WinINet supports. This function is especially useful when the application does not need to access the particulars of a protocol, but only requires the data corresponding to a URL. The INET_Internet_OpenUrl function parses the URL string, establishes a connection to the server, and prepares to download the data identified by the URL. The application can then use INET_Internet_ReadFile  to retrieve the URL data.

 

After the calling application has finished using the hInternet handle returned by INET_Internet_OpenUrl, it must be closed using the INET_Internet_CloseHandle function.

 

When working in asynchronous mode (the dwFlags parameter of INET_Internet_Open specifies %INTERNET_FLAG_ASYNC), and the dwContext parameter is zero (%INTERNET_NO_CALLBACK), the callback function set with INET_Internet_SetStatusCallback on the session handle will not be invoked, however, the call will still be performed in asynchronous mode.

 

Restrictions

 

See also

 

Examples

 

 

Created with Help+Manual 8 and styled with Premium Pack Version 4 © by EC Software