45fan.com - 路饭网

搜索: 您的位置主页 > 网络频道 > 阅读资讯:如何使用WMI获取CPU序列号?

如何使用WMI获取CPU序列号?

2016-09-05 17:32:01 来源:www.45fan.com 【

如何使用WMI获取CPU序列号?

//返回的是一个数组,可能存在多个CPU

using System;

using System.Management;

using System.Collections;

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;

}

}

 

本文地址:http://www.45fan.com/a/question/72829.html
Tags: 获取 cpu wmi
编辑:路饭网
关于我们 | 联系我们 | 友情链接 | 网站地图 | Sitemap | App | 返回顶部