Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Processors / Cores

Status
Not open for further replies.

woogoo

Programmer
Joined
Feb 14, 2004
Messages
247
Location
GB
Hi does anyone know how to detect the number of processors and cores on a machine?

I'd appreciate any comments on this.
 
To get the number of processors, you can use [tt]System.Environment.ProcessorCount[/tt] but I think it's slightly more tricky for cores.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 

Try looking at Win32_Processor and WIn32_ComputerSystem classes in WMI. System.Management namespace is used in .NET to access WMI functions.

Using WMI, you can get much more information about software, hardware, environemnt, networking etc easily and efficiently.

Hope it helps.

 
ca8msm is right, ProcessorCount returns 2 on my dual core machine, and 4 on a dual processor (each a dual core) server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top