There is no method call that directly retuns information about the number and type of installed CPU(s). However, this information is stored in a few environment variables, so it’s just a matter of extracting it with the Environment.GetEnvironmentVariable method:
' this code is meant to run under Windows NT, 2000, or XPConsole.WriteLine("Number of CPUs: {0}", Environment.GetEnvironmentVariable _ ("NUMBER_OF_PROCESSORS"))Console.WriteLine("CPU Architecture: {0}", Environment.GetEnvironmentVariable _ ("PROCESSOR_ARCHITECTURE"))Console.WriteLine("CPU Identifier: {0}", Environment.GetEnvironmentVariable _ ("PROCESSOR_IDENTIFIER"))Console.WriteLine("CPU Level: {0}", Environment.GetEnvironmentVariable _ ("PROCESSOR_LEVEL"))Console.WriteLine("CPU Revision: {0}", Environment.GetEnvironmentVariable _ ("PROCESSOR_REVISION"))
This is a sample output produced by the previous code:
Number of CPUs: 1CPU Architecture: x86CPU Identifier: x86 Family 6 Model 6 Stepping 2, AuthenticAMDCPU Level: 6CPU Revision: 0602