This documentation is archived and is not being maintained.

PhysicalAddress.ToString Method

Returns the String representation of the address of this instance.

Namespace:  System.Net.NetworkInformation
Assembly:  System (in System.dll)

public override string ToString()

Return Value

Type: System.String
A String containing the address contained in this instance.

The following code example demonstrates displaying the address in a PhysicalAddress instance.

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);
void ParseTest()
    PhysicalAddress* address = PhysicalAddress::Parse(S"AC1EBA22");
    Console::WriteLine(S"Address parsed as {0}", address);
    PhysicalAddress* address2 = PhysicalAddress::Parse(S"ac1eba22");
    Console::WriteLine(S"Address2 parsed as {0}", address2);
    bool test = address->Equals(address2);
    Console::WriteLine(S"Equal? {0}", __box(test));

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0