函数参考


_WinAPI_UrlCombine

Combines the base an relative URLs in canonical form.

#Include <WinAPIEx.au3>
_WinAPI_UrlCombine ( $sUrl, $sPart [, $iFlags] )

参数

$sUrl The base URL.
$sPart The relative URL.
$iFlags [可选参数] The flags that specify how the URL is to be converted. It can be a combination of the following values.

$URL_DONT_SIMPLIFY
$URL_ESCAPE_PERCENT
$URL_ESCAPE_SPACES_ONLY
$URL_ESCAPE_UNSAFE
$URL_NO_META
$URL_PLUGGABLE_PROTOCOL
$URL_UNESCAPE

Windows 7 or later

$URL_ESCAPE_AS_UTF8

返回值

Success The combined URL.
Failure Empty string and sets the @error flag to non-zero, @extended flag may contain the system error code.

注意/说明

Items between slashes are treated as hierarchical identifiersthe last item specifies the document itself.
You must enter a slash ("/" ) after the document name to append more itemsotherwise, the function exchanges
one document for another.

If a URL string contains "/../" or "/./", _WinAPI_UrlCombine() usually treats the characters as if they
indicated navigation in the URL hierarchy. The function simplifies the URLs before combining them. For instance,
"/hello/cruel/../world" is simplified to "/hello/world". If the $URL_DONT_SIMPLIFY flag is set, the function
does not simplify URLs. In this case, "/hello/cruel/../world" is left as it is.

相关

详情参考

在MSDN中搜索


示例/演示


#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)

Global $Url1 = 'http://xyz/abc/'
Global $Url2 = 'http://xyz/abc'

ConsoleWrite(_WinAPI_UrlCombine($Url1, 'bar') & @CR)
ConsoleWrite(_WinAPI_UrlCombine($Url2, 'bar') & @CR)