Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Determine type and number of CPUs

Total Hit ( 4547)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


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:

Click here to copy the following block
' this code is meant to run under Windows NT, 2000, or XP
Console.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: 1
CPU Architecture: x86
CPU Identifier: x86 Family 6 Model 6 Stepping 2, AuthenticAMD
CPU Level: 6
CPU Revision: 0602




Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.