Detecting the number of processors

后端 未结 8 1612
耶瑟儿~
耶瑟儿~ 2020-11-30 10:50

How do you detect the number of physical processors/cores in .net?

8条回答
  •  一生所求
    2020-11-30 11:22

    You can use PowerShell to access comprehensive processor information. For example, you can run the following command to get the number of CPU cores:

    Get-WmiObject -namespace root\CIMV2 -class Win32_Processor -Property NumberOfCores
    

    It's much easier to research WMI when using some kind of explorer tool. So, I can suggest using WMI browsing tool (e.g. WMIExplorer or WMI CIM Studio) to explore WMI classes, properties and methods.

提交回复
热议问题