C#: CPU and RAM Performance Meter

1
228

CPUandRAMMeterC#fig.4In this tutorial, I will teach you how to create a CPU and RAM Performance meter in C#.NET. This method will calculate the percentage and determine the usage of the RAM and CPU of a computer.

 

Let’s begin:

Open Microsoft Visual Studio 2008, create a new Windows Form Application for C# and drag the Label, ProgressBar, PerformanceCounter and a Timer. It will look like this.

CPUandRAMMeterC#fig.1

 

After that, click the “pcCPU” PerformanceCounter and go to the properties. In properties of “pcCPU”, select “Processor” for the Category Name,“% Processor Time” for the Counter Name and “_Total” for the Instance Name.

CPUandRAMMeterC#fig.2

 

Then, click  the other PerformanceCounter named “pcRAM” and go to the properties. In the properties, select “Memory” for Category Name and “ %Commited Bytes in Use” for the Counter Name.

CPUandRAMMeterC#fig.3

 

After setting up the two performances counter, double-click a Timer to fire the “Tickevent handler. Then, setup the performance and the percentage of the CPUand RAM of the computer in the method.

 

Go back to the Design Views, and double-click the Form and do the following code to setup interval and start the timer in the first load of the Form.

Output:

CPUandRAMMeterC#fig.4

For all students who need programmer for your thesis system or anyone who needs a source code in any programming languages. You can contact me @ :

 
Email – [email protected]
Mobile No. – 09305235027 – tnt

 

Download Sourcecode

Facebook Comments

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here