EndpointAddress.Equals(Object) 方法

定义

返回一个值,该值指示指定的对象与当前终结点地址是否相等。Returns a value that indicates whether a specified object is equivalent to the current endpoint address.

public:
 override bool Equals(System::Object ^ obj);
public override bool Equals (object obj);
override this.Equals : obj -> bool
Public Overrides Function Equals (obj As Object) As Boolean

参数

obj
Object

要与当前终结点地址进行比较的 ObjectThe Object to be compared to the current endpoint address.

返回

Boolean

如果指定的对象与当前地址相等,则为 true;否则为 falsetrue if the specified object is equivalent to the current address; otherwise, false.

示例

EndpointIdentity endpointIdentity =
    EndpointIdentity.CreateUpnIdentity(WindowsIdentity.GetCurrent().Name);
EndpointAddress endpointAddress = new EndpointAddress(
    new Uri
    ("http://localhost:8003/servicemodelsamples/service/incode/identity"),
    endpointIdentity, addressHeaders);

bool isEqual = endpointAddress.Equals(endpointAddress);

适用于