每台计算机都有一些唯一ID,以区别于其他计算机吗?

我正在使用C#在.NET Framework中开发一个Windows应用程序。我想知道每台计算机是否有任何唯一ID,让它由任何制造商生产,但它必须是唯一的。

谢谢,Bibhu

检查: 如何获取计算机的唯一ID

硬盘ID(卷序列)

查找一个独特的卷序列非常相似,幸运的是更简单:

ManagementObject dsk = new ManagementObject(@"win32_logicaldisk.deviceid=""" + drive + @":"""); dsk.Get(); string volumeSerial = dsk["VolumeSerialNumber"].ToString(); 

如果它是一个Windows应用程序,你可以得到mac地址。 这将是独一无二的。

如何获取mac地址

您可以使用主板序列号:

 public static string GetMBSN() { //Getting list of motherboards ManagementObjectCollection mbCol = new ManagementClass("Win32_BaseBoard").GetInstances(); //Enumerating the list ManagementObjectCollection.ManagementObjectEnumerator mbEnum = mbCol.GetEnumerator(); //Move the cursor to the first element of the list (and most probably the only one) mbEnum.MoveNext(); //Getting the serial number of that specific motherboard return ((ManagementObject)(mbEnum.Current)).Properties["SerialNumber"].Value.ToString(); } 

如果它们都在同一个Windows网络中,请使用计算机名称。 是的,有时它们可​​能具有相同的名称,但是为了访问每台PC,网络将为每个PC分配唯一的名称。