[英]How do I get the CPU socket type? (C#)
I'm developing an application which needs to check the CPU socket type at some point. 我正在开发一个需要在某些时候检查CPU插槽类型的应用程序。 How can I get the proper socket? 如何获得合适的插座? I tried to do it via WMI using Win32_Processor class, but I couldn't find descriptions of modern sockets at MSDN help ( http://msdn.microsoft.com/en-us/library/windows/desktop/aa394373(v=vs.85).aspx ) There are only old kinds of sockets. 我尝试使用Win32_Processor类通过WMI做到这一点,但在MSDN帮助中找不到现代套接字的描述( http://msdn.microsoft.com/zh-cn/library/windows/desktop/aa394373(v=vs .85).aspx )只有老式的套接字。 Where can I get the updated info for this stuff? 在哪里可以获取有关该产品的更新信息? Or maybe there is an alternate way to get a socket information? 也许还有另一种获取套接字信息的方法? Thanks in advance. 提前致谢。
You can use System.Management.Instrumentation
to query Win32_Processor
您可以使用System.Management.Instrumentation
查询Win32_Processor
Example: 例:
string processorSocket;
var processor = new ManagementObjectSearcher("select * from Win32_Processor").Get().Cast<ManagementObject>().FirstOrDefault();
if (processor != null)
{
processorSocket = (string)processor["SocketDesignation"];
}
// returns: Socket M2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.