473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

% Processor metric in C#

Is there a way, in C#, to query the OS for the processor %
utilization.
Nov 15 '05 #1
2 1285
Hi,

I think you can use Windows Management Instrumentation for doing such
query. In a nutshell, WMI is an OS instrumentation layer with which you
can interact with queries like
"Select * from Win32_LogicalDisk WHERE FreeSpace < 2000000"

It's pretty cool because you can access lots of machine's resources this
way (processes, I/O, etc.). WMI can also fire events that you can
subscribe (for example if memory comsuption is above certain threshold).
Check the System.Management.Instrumentation in MSDN and the WMI query
language reference in Technet.

HTH,

Ramiro

john wrote:
Is there a way, in C#, to query the OS for the processor %
utilization.


Nov 15 '05 #2
Check the PerformanceCounter class in the System.Diagnostics namespace.

Willy.

"john" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
Is there a way, in C#, to query the OS for the processor %
utilization.

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

52
by: piaseckiac | last post by:
I am producing a website on air and need a link to change the entire website from standard to metric for temperature, pressure, miles-kilometers, and volume. Thank you.
8
by: Rainer Queck | last post by:
Hi NG, in a dataset.datatable I have rows, containing metric data as doubles. I need to display/edit these values in textboxes depending on the culture (Metric/Inch). Is there something like a...
3
by: socondc22 | last post by:
Im stuck at this point. The way i was trying to do this was running if statement around my void function and then a else if statement around a different void function but it didnt work... right now...
2
by: cbmeeks | last post by:
Man, I realize I've been asking a lot of questions lately. I appreciate you guys helping me in my thought process. This time, I have a design question I want opinions on. I'm building a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.