日期:2014-05-18 浏览次数:21635 次
/// <summary> ///取CPU编号 /// </summary> /// <returns></returns> public static string GetCpuID() { try { ManagementClass mc = new ManagementClass("Win32_Processor"); ManagementObjectCollection moc = mc.GetInstances(); string strCpuID = null; foreach (ManagementObject mo in moc) { strCpuID = mo.Properties["ProcessorId"].Value.ToString(); break; } return strCpuID; } catch { return ""; } }
------解决方案--------------------
http://www.codeproject.com/KB/system/GetHardwareInformation.aspx