How do you get the number of CPUs?

How do you get the number of CPUs or CPU cores present on the system your .NET application is running on? I guess it's either in the System.Diagnostics or System.Threading namespaces.
I'm interested in dividing a task (consisting of several unconnected problems) between multiple threads so that the CPU or core count can be exploited for better performance. The FxCop code analysis tool's number of threads defaults to the number of CPUs (or cores).
[457 byte] By [Kea] at [2007-12-22]
# 1
System.Environment.ProcessorCount in .NET 2.0

nobugz at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 2
Thanks! My search for cpu count in MSDN only gave me matches on count properties in lists, queues and stacks...
Kea at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Base Class Library...

.NET Development

Site Classified