PC Review


Reply
Thread Tools Rate Thread

C# .Net Equivalent of NtQuerySystemInformation ?

 
 
=?Utf-8?B?RW56bw==?=
Guest
Posts: n/a
 
      7th Jan 2005
What I need to be able to detect is when the CPU or CPUs of a system are idle
or no more than 10% busy. Back in my C++ days we used
NtQuerySystemInformation. Is there an easier way built into the .Net
Platform or C#?


 
Reply With Quote
 
 
 
 
Q. John Chen
Guest
Posts: n/a
 
      7th Jan 2005
I think it in System.Diagnostics.PerformanceCounter. Search for
PerformanceCounter in this group and you should be able to find what
you want.

Enzo wrote:
> What I need to be able to detect is when the CPU or CPUs of a system

are idle
> or no more than 10% busy. Back in my C++ days we used
> NtQuerySystemInformation. Is there an easier way built into the .Net
> Platform or C#?


 
Reply With Quote
 
=?Utf-8?B?RW56bw==?=
Guest
Posts: n/a
 
      8th Jan 2005
John,

Thanks for the reply. I found a way to use performance counters but there
seems to be no way to handle multiple CPUs

"Q. John Chen" wrote:

> I think it in System.Diagnostics.PerformanceCounter. Search for
> PerformanceCounter in this group and you should be able to find what
> you want.
>
> Enzo wrote:
> > What I need to be able to detect is when the CPU or CPUs of a system

> are idle
> > or no more than 10% busy. Back in my C++ days we used
> > NtQuerySystemInformation. Is there an easier way built into the .Net
> > Platform or C#?

>
>

 
Reply With Quote
 
Q. John Chen
Guest
Posts: n/a
 
      11th Jan 2005
I don't know what you found out and I don't have multiple CPU machine
to test.

But how about this?
CategoryName = "Process"; // Instead of processor
CounterName = "% Processor Time";
InstanceName = "Idle";
MachineName = "MY-MACHINE";

 
Reply With Quote
 
=?Utf-8?B?RW56bw==?=
Guest
Posts: n/a
 
      15th Jan 2005
Thanks John,

Yes, that may work because it is looking at the Idle process itself. I will
have to try it and see what happens.

"Q. John Chen" wrote:

> I don't know what you found out and I don't have multiple CPU machine
> to test.
>
> But how about this?
> CategoryName = "Process"; // Instead of processor
> CounterName = "% Processor Time";
> InstanceName = "Idle";
> MachineName = "MY-MACHINE";
>
>

 
Reply With Quote
 
Q. John Chen
Guest
Posts: n/a
 
      16th Jan 2005
Please post the result here. I am interested to know also.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parameter "ReturnLength" always "0" when NtQuerySystemInformation is called,... Kerem Gümrükcü Microsoft C# .NET 2 6th Sep 2008 12:44 PM
Re: chr() .Net equivalent \(O\)enone Microsoft VB .NET 1 10th Apr 2008 07:58 PM
Equivalent of GetPrivateProfileString equivalent in C#? Germic Microsoft C# .NET 1 24th Jan 2005 09:22 AM
.Net Equivalent to MTS. Clive Mizen Microsoft VB .NET 6 12th Jul 2004 12:08 PM
SSI Equivalent Bernardo Heynemann Microsoft ASP .NET 1 1st Dec 2003 03:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:43 AM.