EndpointAddress.Inequality(EndpointAddress, EndpointAddress) 操作员

定义

返回一个值,该值指示指定的终结点地址是否不相等。

public:
 static bool operator !=(System::ServiceModel::EndpointAddress ^ address1, System::ServiceModel::EndpointAddress ^ address2);
public static bool operator != (System.ServiceModel.EndpointAddress address1, System.ServiceModel.EndpointAddress address2);
static member op_Inequality : System.ServiceModel.EndpointAddress * System.ServiceModel.EndpointAddress -> bool
Public Shared Operator != (address1 As EndpointAddress, address2 As EndpointAddress) As Boolean

参数

address1
EndpointAddress

要比较的 EndpointAddress 对象之一。

address2
EndpointAddress

要比较的 EndpointAddress 对象之一。

返回

如果终结点地址不等同,则为 true;否则为 false

示例

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

bool op_Inequality_val = (endpointAddress1 != endpointAddress2);

注解

此运算符 EndpointAddress.Equals的等效方法是 。

适用于