System.Net.NetworkInformation.PhysicalAddress.Parse Method

Parses the specified string and stores its contents as the address bytes of the System.Net.NetworkInformation.PhysicalAddress returned by this method.

Syntax

public static PhysicalAddress Parse (string address)

Parameters

address
A string containing the address that will be used to initialize the System.Net.NetworkInformation.PhysicalAddress instance returned by this method.

Returns

A System.Net.NetworkInformation.PhysicalAddress instance with the specified address.

Remarks

The address parameter must contain a string that can only consist of numbers and upper-case letters as hexadecimal digits. Some examples of string formats that are acceptable are as follows:

001122334455

00-11-22-33-44-55

F0-E1-D2-C3-B4-A5

Note that an address that contains f0-e1-d2-c3-b4-a5 will fail to parse and throw an exception.

Use the PhysicalAddress.GetAddressBytes method to retrieve the address from an existing System.Net.NetworkInformation.PhysicalAddress instance.

Requirements

Namespace: System.Net.NetworkInformation
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0