获取CPU串行 [英] Getting CPU Serial

查看:76
本文介绍了获取CPU串行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我想在我的应用程序中获取CPU序列号.请帮助我.

Hi I want to get CPU serial no in my application. please help me.

推荐答案

public static string GetCPUSerialNumber()
{
    string cpuSerialNumber = string.Empty;
    ManagementClass mc = new ManagementClass("Win32_Processor");
    ManagementObjectCollection moc = mc.GetInstances();
    foreach (ManagementObject mo in moc)
    {
        cpuSerialNumber = mo["ProcessorId"].ToString();
        break;
    }
    mc.Dispose();
    moc.Dispose();
    return cpuSerialNumber;
}



您应该添加此参考System.Management



you should add this reference System.Management


请注意,当前的 CPU 不支持通过软件获取序列号 :它是 Intel 于一年前推出的一项功能,由于对隐私问题的大量批评而被取消.
Be aware that current CPUs doesn''t support getting the serial number through software: it was a feature introduced by Intel some year ago and then dismissed, due to lot of criticism about privacy issues.


这篇关于获取CPU串行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆