ManagementClass MyClass=new ManagementClass("Win32_Processor");
ManageObjectCollection MyCollection=MyClass.GetInstances();
String MyInfo="当前的CPU编号是:";
String MyCPUID=string.Empty;
foreach(ManagementObject MyObject in MyCollection)
{
MyCPUID=MyObject.Properties["ProcessorId"].Value.ToString();
break;
}
MyInfo+=MyCPUID;
MessageBox.Show(MyInfo,"信息提示",MessageBoxButtons.OK,MessageBoxIcon.Information);