函数参考


_WinAPI_UrlCompare

Makes a case-sensitive comparison of two URL strings.

#Include <WinAPIEx.au3>
_WinAPI_UrlCompare ( $sUrl1, $sUrl2 [, $fIgnoreSlash] )

参数

$sUrl The first URL.
$sPart The second URL.
$fIgnoreSlash [可选参数] Specifies whether to ignore a trailing '/' character on either or both URLs, valid values:
TRUE - The function ignores a trailing characters.
FALSE - The function takes into account the trailing characters. (Default)

返回值

Success 0 - The URLs are equal.
1 - The first URL is greater than the second URL.
(-1)- The first URL is less than the second URL.
失败: 返回 0 并设置 @error 标志为非 0 值.

注意/说明

For best results, you should first canonicalize the URLs with _WinAPI_UrlCanonicalize(). Then, compare the
canonicalized URLs with _WinAPI_UrlCompare().

相关

详情参考

在MSDN中搜索


示例/演示


#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)

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

ConsoleWrite('URLs comparison result: ' & _WinAPI_UrlCompare($Url1, $Url2) & @CR)