Function Reference


_WinAPI_UrlGetPart

Retrieves a specified part from the URL

#include <WinAPIShPath.au3>
_WinAPI_UrlGetPart ( $sUrl, $iPart )

Parameters

$sUrl The URL.
$iPart The part of the URL to retrieve. It can be one of the following values.
$URL_PART_HOSTNAME
$URL_PART_PASSWORD
$URL_PART_PORT
$URL_PART_QUERY
$URL_PART_SCHEME
$URL_PART_USERNAME

Return Value

Success: The part of the URL.
Failure: Sets the @error flag to non-zero, @extended flag may contain the s error code.

See Also

Search UrlGetPart in MSDN Library.

Example

#include <APIShPathConstants.au3>
#include <WinAPIShPath.au3>

Local $sUrl = 'http://social.msdn.microsoft.com/search/en-us?query=UrlGetPart'

ConsoleWrite('Scheme: ' & _WinAPI_UrlGetPart($sUrl, $URL_PART_SCHEME) & @CRLF)
ConsoleWrite('Host:   ' & _WinAPI_UrlGetPart($sUrl, $URL_PART_HOSTNAME) & @CRLF)
ConsoleWrite('Query:  ' & _WinAPI_UrlGetPart($sUrl, $URL_PART_QUERY) & @CRLF & @CRLF)

$sUrl = 'http://social.msdn.microsoft.com/search/en-ust'

ConsoleWrite('Scheme: ' & _WinAPI_UrlGetPart($sUrl, $URL_PART_SCHEME) & @CRLF)
ConsoleWrite('Host:   ' & _WinAPI_UrlGetPart($sUrl, $URL_PART_HOSTNAME) & @CRLF)
ConsoleWrite('Query:  ' & _WinAPI_UrlGetPart($sUrl, $URL_PART_QUERY) & ' @error = ' & @error & ' @extended = 0x' & Hex(@extended) & @CRLF)