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

Definición

Compara las partes especificadas de dos identificadores URI utilizando las reglas de comparación especificadas.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

Parámetros

uri1
Uri Uri Uri Uri

Primer objeto Uri.The first Uri.

uri2
Uri Uri Uri Uri

Segundo objeto Uri.The second Uri.

partsToCompare
UriComponents UriComponents UriComponents UriComponents

Combinación bit a bit de los valores UriComponents que especifica las partes de uri1 y uri2 que se van a comparar.A bitwise combination of the UriComponents values that specifies the parts of uri1 and uri2 to compare.

compareFormat
UriFormat UriFormat UriFormat UriFormat

Uno de los valores UriFormat que especifica la secuencia de escape de carácter usada al comparar los componentes del identificador URI.One of the UriFormat values that specifies the character escaping used when the URI components are compared.

Devoluciones

Valor Int32 que indica la relación léxica entre los componentes Uri comparados.An Int32 value that indicates the lexical relationship between the compared Uri components.

ValorValue SignificadoMeaning
Menor que ceroLess than zero uri1 es menor que uri2.uri1 is less than uri2.
CeroZero uri1 es igual que uri2.uri1 equals uri2.
Mayor que ceroGreater than zero uri1 es mayor que uri2.uri1 is greater than uri2.

Excepciones

comparisonType no es un valor StringComparison válido.comparisonType is not a valid StringComparison value.

Comentarios

Si uri1 y uri2 son null, este método devuelve 0.If both uri1 and uri2 are null, this method returns 0. Al comparar los valores de URI, un URI relativo siempre es menor que un URI absoluto y un URI que no es NULL siempre es mayor que un URI nulo.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. En los casos en los que uri1 y uri2 no son null y son URI relativos o ambos URI absolutos, el método String.Compare(String, String, StringComparison) realiza la comparación.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.

Se aplica a