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.

comparisonType
StringComparison StringComparison StringComparison StringComparison

StringComparison 値のいずれか 1 つ。One of the StringComparison values.

戻り値

比較する 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.

注釈

nulluri1 の両方がの場合、このメソッドは0を返します。uri2If 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. uri1 null String.Compare(String, String, StringComparison)の両方がではなく、相対 uri でも両方の絶対 uri でもある場合、メソッドは比較を実行します。 uri2For 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.

適用対象