本文共 1210 字,大约阅读时间需要 4 分钟。
-
-
-
-
-
-
-
-
public static string getID_CpuId() -
-
-
ManagementClass cimobject = new ManagementClass("Win32_Processor"); -
ManagementObjectCollection moc = cimobject.GetInstances(); -
foreach (ManagementObject mo in moc) -
-
cpuInfo = mo.Properties["ProcessorId"].Value.ToString(); -
-
-
-
-
-
-
-
-
public static string getID_HardDiskId() -
-
-
ManagementClass cimobject = new ManagementClass("Win32_DiskDrive"); -
ManagementObjectCollection moc = cimobject.GetInstances(); -
foreach (ManagementObject mo in moc) -
-
HDid = (string)mo.Properties["Model"].Value; -
-
-
-
-
-
-
-
-
public static string getID_NetCardId() -
-
-
ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration"); -
ManagementObjectCollection moc = mc.GetInstances(); -
foreach (ManagementObject mo in moc) -
-
if ((bool)mo["IPEnabled"] == true) -
NCid = mo["MacAddress"].ToString(); -
-
-
-
-
-
-
-
转载于:https://www.cnblogs.com/xiaz/p/4588014.html