Monday, September 19, 2011

MAC Address of System

Step1 :---Add Namespace
        using System.Net.NetworkInformation;
Step2:-----Add Below Code in Your button Click Event

string macAddresses = "";
        foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
        {
            if (nic.OperationalStatus == OperationalStatus.Up)
            {
                macAddresses += nic.GetPhysicalAddress().ToString();
                break;
            }
        }      
        lblMsg.Text = macAddresses.ToString();

No comments:

Post a Comment