閱讀英文版本 編輯

分享方式:


PackUriHelper.ComparePackUri(Uri, Uri) Method

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Returns a value that indicates whether two pack URIs are equivalent.

C#
public static int ComparePackUri(Uri? firstPackUri, Uri? secondPackUri);
C#
public static int ComparePackUri(Uri firstPackUri, Uri secondPackUri);

Parameters

firstPackUri
Uri

The first pack URI.

secondPackUri
Uri

The second pack URI.

Returns

A signed integer indicating the relationship between firstPackUri and secondPackUri.

Value Meaning
Less than 0 firstPackUri is less than secondPackUri.
0 firstPackUri is equivalent to secondPackUri.
Greater than 0 firstPackUri is greater than secondPackUri.

Exceptions

Either firstPackUri or secondPackUri is not an absolute URI.

-or-

Either firstPackUri or secondPackUri do not begin with a "pack://" scheme.

Remarks

If both firstPackUri and secondPackUri are null, ComparePackUri returns 0. When comparing pack URIs, a null URI is always less than a non-null URI. For cases where firstPackUri and secondPackUri are both absolute pack URIs, ComparePackUri performs the comparison.

Applies to

產品 版本
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also