PhysicalAddress.Equals Method (Object)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Compares two PhysicalAddress instances.

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

public override bool Equals(
	object comparand
)

Parameters

comparand
Type: System.Object

The PhysicalAddress to compare to the current instance.

Return Value

Type: System.Boolean

true if this instance and the specified instance contain the same address; otherwise false.

The following code example compares two PhysicalAddress instances.

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);
}

.NET Framework
Available since 2.0
Return to top
Show: