Use WMI to get the CPU serial number

xiaoxiao2021-03-06  73

// Returns an array, there may be multiple CPUs for systems; use system.collement; public arraylist getcpuid () {arraylist al = new arraylist ();

try {ManagementClass mc = new ManagementClass ( "Win32_Processor"); ManagementObjectCollection moc = mc.GetInstances (); foreach (ManagementObject mo in moc) {al.Add (mo.Properties [ "ProcessorId"] Value.ToString ().); } Return Al;} catCH () {Return NULL;}

}

转载请注明原文地址:https://www.9cbs.com/read-93406.html

New Post(0)