Click here to Skip to main content
13,349,032 members (68,956 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


10 bookmarked
Posted 25 Sep 2009

find out how processor load using wmi

, 25 Sep 2009
Rate this:
Please Sign up or sign in to vote.
Example of how to find out the processor load using wmi (windows management instrument)

Sample Image - maximum width is 600 pixels


Example of how to find out the processor load using wmi (windows management instrument)
WMI is an administrative tool included with the windows systems. For administrators
with WMI access to all information of a pc, such as memory, hard disk, network card, processor, short quite easily without programming in Assembly to gain access to this information can be...
for more information about WMI can go to this address

Using the Code

To determine the processor load we must creates an instance of WMI and so use the member functions of object.
To create a WMI instacia be follows.

<pre> ManagementObject processor = new ManagementObject();</pre>

ManagementObject has several overloaded, constructore with miscellaneous parameter, in our case, we'll use in type string constructor and passing data you wish to have access to information, telling that we want to have the burden of processor and system information. In this way

<pre>ManagementObject processor = new ManagementObject( "Win32_PerfFormattedData_PerfOS_Processor.Name='_Total'") 

Win32_PerfFormattedData_PerfOS_Processor. It is a responsible for WMI classes of da charging system on the processor, through its Name property condition information passing finds it _Total we want the total value of the system overhead.

A view that we see a ManagementObject instance created will use the Get method of the ManagementObject classes for associated instance object created in this way


in this way we can already calls to the method and properties in classes, in this case call the object properties that it will not return the value of the properties of the query object properties here will not return the percentage of processor time


to summarize all do so

<pre>ManagementObject processor = new ManagementObject(


as ye see the code short compared if we had used Assembly low-level by directly calling the bios is

to continuation or I will leave the code strong example as shown in this shot.

Sample Image - maximum width is 600 pixels

the code you can modify or distribute it only to do mensio author this program set yourselves in the following image is fine-tuning the code and them is converted into a sensor

Sample Image - maximum width is 600 pixels

space used name: using System.Management;
reference: System.Management.DLL


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer
Spain Spain
No Biography provided

You may also be interested in...


Comments and Discussions

GeneralExactly what i was looking for! Pin
MatheusMK325-Jan-10 8:52
memberMatheusMK325-Jan-10 8:52 
I was looking for that some time ago, thanks!!!

public void showSignature(object sender, MyForumSignatureEventArgs e)
signatureLabel.Text = e.Signature("MatheusMK3", "", "Forum");

GeneralMy vote of 1 Pin
Hotcut27-Sep-09 22:49
memberHotcut27-Sep-09 22:49 
GeneralRe: My vote of 1 Pin
jesuli28-Sep-09 5:18
memberjesuli28-Sep-09 5:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.180111.1 | Last Updated 25 Sep 2009
Article Copyright 2009 by jesuli
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid