none
Unique Machine Identifier RRS feed

  • Question

  • Can anyone suggest a mechanism for gettting a reasonably unique machine identifier.  I.e. a value that is reasonably unique on a machine by machine basis.  I looked at using a Security Identifier, but these seem only to be unique for a particular system.
    Monday, February 19, 2007 10:39 AM

Answers

  • How about the MAC address of your network card?

    public static void DisplayTypeAndAddress()
     {
        IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties();  
        NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();  
        Console.WriteLine("Interface information for {0}.{1} ", computerProperties.HostName,  
                                      computerProperties.DomainName);

      foreach (NetworkInterface adapter in nics)
     {
         IPInterfaceProperties properties = adapter.GetIPProperties();
         Console.WriteLine(adapter.Description);
         Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length,'='));
        Console.WriteLine(" Interface type .......................... : {0}",
         adapter.NetworkInterfaceType); Console.WriteLine(" Physical Address ........................ : {0}", adapter.GetPhysicalAddress().ToString());
     }
    }


    Yours,
       Alois Kraus

    Monday, February 19, 2007 9:38 PM