|
-
Sep 27th, 2005, 07:53 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] displaying cpu usage
hi. I'm trying to display the cpu usage ofmycomputer. I'm not a coding genius and i'm sure its just a simple mistake. Here's the code the I have:
PerformanceCounter CpuCounter;
CpuCounter = new PerformanceCounter();
CpuCounter.CategoryName = "Processor";
CpuCounter.CounterName = "% Processor Time";
CpuCounter.InstanceName = "_Total";
txtCPU.Text = CpuCounter.NextValue().ToString();
Just that its displaying the value 0 every time I run it. Also I tried using the RawValue method but the value being displayed is just too large. Could somebody help me pleaseeeeeee
Jennifer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|