How can I get the NAME processor of my machine using C # (.NET 3.5)?

I need to find the name and speed of the processor on my machine. I am creating an open source help desk package and find this very interesting!

Thanks for helping the guys!

+3
source share
2 answers

As others pointed out using WMI. Do this by adding a link 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"]);
    }

Besides "Name", WMI also provides other interesting facts about your processor. See http://msdn.microsoft.com/en-us/library/aa394373(VS.85).aspx for a final list.

+6
source
System.Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER")

-. , .

+3

Source: https://habr.com/ru/post/1742674/


All Articles