Uri.Compare(Uri, Uri, UriComponents, UriFormat, StringComparison) Uri.Compare(Uri, Uri, UriComponents, UriFormat, StringComparison) Uri.Compare(Uri, Uri, UriComponents, UriFormat, StringComparison) Uri.Compare(Uri, Uri, UriComponents, UriFormat, StringComparison) Method

定義

指定した比較規則を使用して、2 つの URI の指定部分を比較します。Compares the specified parts of two URIs using the specified comparison rules.

public:
 static int Compare(Uri ^ uri1, Uri ^ uri2, UriComponents partsToCompare, UriFormat compareFormat, StringComparison comparisonType);
public static int Compare (Uri uri1, Uri uri2, UriComponents partsToCompare, UriFormat compareFormat, StringComparison comparisonType);
static member Compare : Uri * Uri * UriComponents * UriFormat * StringComparison -> int
Public Shared Function Compare (uri1 As Uri, uri2 As Uri, partsToCompare As UriComponents, compareFormat As UriFormat, comparisonType As StringComparison) As Integer

パラメーター

uri1
Uri Uri Uri Uri

最初の UriThe first Uri.

uri2
Uri Uri Uri Uri

第 2 の UriThe second Uri.

partsToCompare
UriComponents UriComponents UriComponents UriComponents

比較する UriComponentsuri1 の部分を指定する uri2 値のビットごとの組み合わせ。A bitwise combination of the UriComponents values that specifies the parts of uri1 and uri2 to compare.

compareFormat
UriFormat UriFormat UriFormat UriFormat

URI の構成要素の比較時に使用する文字エスケープを指定する UriFormat 値の 1 つ。One of the UriFormat values that specifies the character escaping used when the URI components are compared.

戻り値

比較する Int32 構成要素の構文上の関係を示す Uri 値。An Int32 value that indicates the lexical relationship between the compared Uri components.

[値]Value 説明Meaning
0 より小さい値Less than zero uri1uri2 より小さい値です。uri1 is less than uri2.
0Zero uri1uri2 は等しい。uri1 equals uri2.
0 より大きい値Greater than zero uri1uri2 より大きくなっています。uri1 is greater than uri2.

例外

comparisonType は有効な StringComparison 値ではありません。comparisonType is not a valid StringComparison value.

注釈

両方uri1uri2null、このメソッドは 0 を返します。If both uri1 and uri2 are null, this method returns 0. URI の値を比較するときに相対 URI は常に絶対 URI、および null 以外の URI が null の URI より大きいは常により小さい。When comparing URI values, a relative URI is always less than an absolute URI, and a non-null URI is always greater than a null URI. 場合、両方uri1uri2ないnullは相対 Uri または、両方の絶対 Uri の両方と、String.Compare(String, String, StringComparison)メソッドは、比較を実行します。For cases where both uri1 and uri2 are not null and are both relative URIs or both absolute URIs, the String.Compare(String, String, StringComparison) method performs the comparison.

適用対象