EndpointAddress.Equality(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 ( = ) : System.ServiceModel.EndpointAddress * System.ServiceModel.EndpointAddress -> bool
Public Shared Operator == (address1 As EndpointAddress, address2 As EndpointAddress) As Boolean

参数

address1
EndpointAddress

要比较的 EndpointAddress 对象之一。

address2
EndpointAddress

要比较的 EndpointAddress 对象之一。

返回

Boolean

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

示例

EndpointAddress endpointAddress = new EndpointAddress(
    new Uri("http://localhost:8003/servicemodelsamples/service/incode/identity"), addressHeaders);
EndpointAddress endpointAddress2 = new EndpointAddress(
   new Uri("http://localhost:8003/servicemodelsamples/service/incode/identity"), addressHeaders);

if (endpointAddress == endpointAddress2)
    Console.WriteLine("The two endpoint addresses are equal");
else
    Console.WriteLine("The two endpoint addresses are not equal");

注解

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

适用于