Wednesday, June 15, 2022

How to get Machine Address with C# ASP.NET

 public string MachineAddress()

    {

        NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();

        //display the physical address of the first nic in the array,

        //which should correspond to our mac address

        return (nics[0].GetPhysicalAddress().ToString());


    }

No comments:

Post a Comment