Uri.Equals 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
오버로드
| Name | Description |
|---|---|
| Equals(Object) |
두 Uri 인스턴스를 같음으로 비교합니다. |
| Equals(Uri) |
두 Uri 인스턴스를 같음으로 비교합니다. |
Equals(Object)
- Source:
- Uri.cs
- Source:
- Uri.cs
- Source:
- Uri.cs
- Source:
- Uri.cs
- Source:
- Uri.cs
두 Uri 인스턴스를 같음으로 비교합니다.
public:
override bool Equals(System::Object ^ comparand);
public override bool Equals(object comparand);
public override bool Equals(object? comparand);
override this.Equals : obj -> bool
Public Overrides Function Equals (comparand As Object) As Boolean
매개 변수
- comparand
- Object
현재 인스턴스와 비교할 URI 또는 URI 식별자입니다.
반품
true두 인스턴스가 동일한 URI를 나타내는 경우 그렇지 않으면 . false
예제
이 예제에서는 문자열에서 두 개의 Uri 인스턴스를 만들고 비교하여 동일한 값을 나타내는지 여부를 확인합니다.
// Create some Uris.
Uri address1 = new Uri("http://www.contoso.com/index.htm#search");
Uri address2 = new Uri("http://www.contoso.com/index.htm");
if (address1.Equals(address2))
Console.WriteLine("The two addresses are equal");
else
Console.WriteLine("The two addresses are not equal");
// Will output "The two addresses are equal"
// Create some Uris.
let address1 = Uri "http://www.contoso.com/index.htm#search"
let address2 = Uri "http://www.contoso.com/index.htm"
if address1.Equals address2 then
printfn "The two addresses are equal"
else
printfn "The two addresses are not equal"
// Will output "The two addresses are equal"
' Create some Uris.
Dim address1 As New Uri("http://www.contoso.com/index.htm#search")
Dim address2 As New Uri("http://www.contoso.com/index.htm")
If address1.Equals(address2) Then
Console.WriteLine("The two addresses are equal")
Else
Console.WriteLine("The two addresses are not equal")
End If
' Will output "The two addresses are equal"
설명
이 메서드는 Equals 포함할 수 있는 사용자 정보() 및 조각(UserInfoFragment) 부분과 관계없이 두 인스턴스를 비교합니다. 예를 들어 URI http://www.contoso.com/index.htm#search 를 지정하면 http://user:password@www.contoso.com/index.htm메서드가 Equals 반환 true됩니다.
한 Uri 인스턴스가 유니코드 호스트 이름으로 구성되고 comparand 매개 변수에 해당하는 Punycode Uri 호스트 이름을 가진 호스트 이름으로 구성된 인스턴스 또는 식별자가 포함된 Equals 경우 IRI(International Resource Identifier) 및 IDN(Internationalized Domain Name) 지원이 활성화된 경우에만 반환 true 됩니다. Punycode 이름은 ASCII 문자만 포함하며 항상 xn-- 접두사로 시작합니다.
IRI 지원에 대한 자세한 내용은 클래스의 설명 섹션을 Uri 참조하세요.
메모
.NET Framework 버전 1.0 및 1.1에서는 Query 무시됩니다.
메모
메서드는 파생 클래스에서 재정의 Equals 할 수 있습니다. 악의적인 엔터티가 메서드를 수정할 수 있으므로 주의해야 합니다. 이 인스턴스가 신뢰할 수 있는 원본에서 온 것을 알지 못하는 한 이 메서드를 사용하여 보안 검사를 수행하면 안 됩니다.