欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

C#獲取CPU編號(hào)的方法

 更新時(shí)間:2015年07月22日 10:13:54   作者:冰封的心  
這篇文章主要介紹了C#獲取CPU編號(hào)的方法,實(shí)例分析了C#獲取硬件信息的相關(guān)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下

本文實(shí)例講述了C#獲取CPU編號(hào)的方法。分享給大家供大家參考。具體如下:

/// <summary>
/// Gets the cpu 編號(hào).
///需引用 using System.Management;
/// </summary>
/// <returns></returns>
public string GetCpuId()
{
   string cpuInfo = "";
   ManagementClass cimobject = new ManagementClass("Win32_Processor");
   ManagementObjectCollection moc = cimobject.GetInstances();
   foreach (ManagementObject mo in moc)
   {
     cpuInfo = mo.Properties["ProcessorId"].Value.ToString();
   }
   return cpuInfo;
}

希望本文所述對(duì)大家的C#程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論