次の方法で共有


PhysicalAddress.Equals(Object) メソッド

定義

2 つの 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

次のコード例では、2 つの 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);
}

適用対象