Tuesday 7 August 2012

Beginning .Net , C# Tips : Get number of processors on the machine

You can get processors count on your machine.
We are using "ProcessorCount" property of "System.Environment" class.

Here is example for this.
In this example we display Processor count on screen

C# Examples :
Response.Write("<b>Number of Processor :</b> " + Environment.ProcessorCount);

VB.net Examples :
Response.Write("<b>Number of Processor :</b> " & Environment.ProcessorCount)

Output :


This type of C# Tips is very useful in day to day programming life.

Note : Give Us your valuable feedback in comments. Give your suggestions in this article so we can update our articles accordingly that.



1 comment: