PhysicalAddress.Equals(Object) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
比较两个 PhysicalAddress 实例。
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
要与当前实例进行比较的 PhysicalAddress。
返回
如果此实例和指定的实例包含相同的地址,则为 true
,否则为 false
。
示例
下面的代码示例比较两 PhysicalAddress 个 实例。
void ParseTest()
{
PhysicalAddress^ address = PhysicalAddress::Parse( L"AC1EBA22" );
Console::WriteLine( L"Address parsed as {0}", address->ToString() );
PhysicalAddress^ address2 = PhysicalAddress::Parse( L"ac1eba22" );
Console::WriteLine( L"Address2 parsed as {0}", address2->ToString() );
bool test = address->Equals( address2 );
Console::WriteLine( L"Equal? {0}", test );
}
public static void ParseTest()
{
PhysicalAddress address = PhysicalAddress.Parse("AC1EBA22");
Console.WriteLine("Address parsed as {0}", address.ToString());
PhysicalAddress address2 = PhysicalAddress.Parse("ac1eba22");
Console.WriteLine("Address2 parsed as {0}", address2.ToString());
bool test = address.Equals(address2);
Console.WriteLine("Equal? {0}", test);
}