PhysicalAddress.ToString 方法

定义

返回此实例的地址的 String 表示形式。

public:
 override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

返回

一个 String,其中包含此实例中所含的地址。

示例

下面的代码示例演示如何在 实例中 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);
}

适用于