我怎样才能得到我的机器上使用C#的处理器名称(.NET 3.5)? [英] How can I get the processor NAME of my machine using C#(.NET 3.5)?

查看:106
本文介绍了我怎样才能得到我的机器上使用C#的处理器名称(.NET 3.5)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要找到我的机器上处理器的名称和速度。我建立一个开源的服务台套件并发现这真是有趣!

I need to find the Name and speed of the processor on my machine. I'm building an open source help desk suite and finding this really entertaining!

感谢您的帮助家伙!

推荐答案

正如其他人指出,使用WMI。通过增加提及System.Management.dll,然后调用下面code执行这样的:

As the others have pointed out, using WMI. Do this by adding a reference to System.Management.dll, then calling the following code:

ManagementObjectSearcher mos = 
  new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_Processor");
    foreach (ManagementObject mo in mos.Get()) {
      Console.WriteLine(mo["Name"]);
    }

除了姓名,WMI还暴露了你的处理器的其他有趣的事实。看看 http://msdn.microsoft.com/ EN-US /库/ aa394373(VS.85)的.aspx 的最终名单。

这篇关于我怎样才能得到我的机器上使用C#的处理器名称(.NET 3.5)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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