Click here to Skip to main content
15,907,687 members
Home / Discussions / C#
   

C#

 
AnswerRe: Unable to copy error in C# Pin
Pete O'Hanlon30-Mar-09 0:39
mvePete O'Hanlon30-Mar-09 0:39 
AnswerRe: Unable to copy error in C# Pin
musefan30-Mar-09 0:39
musefan30-Mar-09 0:39 
GeneralRe: Unable to copy error in C# Pin
mrithula830-Mar-09 0:45
mrithula830-Mar-09 0:45 
Questionneed to access the value of property "SETUPEXEDIR" Pin
honeyashu30-Mar-09 0:27
honeyashu30-Mar-09 0:27 
Questionpagination of datagrid Pin
dilip51430-Mar-09 0:08
dilip51430-Mar-09 0:08 
AnswerRe: pagination of datagrid Pin
Christian Graus30-Mar-09 0:29
protectorChristian Graus30-Mar-09 0:29 
QuestionSocket forcibly closed Pin
__DanC__29-Mar-09 23:10
__DanC__29-Mar-09 23:10 
QuestionMonitoring Process CPU usage using WMI Pin
eli1502197929-Mar-09 22:46
eli1502197929-Mar-09 22:46 
Hi,

I'm trying to write an application which monitor another application using WMI.
One of the parameter I need to monitor is CPU usage by the monitored application.
Just for the test - The tested process is devenv.exe(i.e Visual studio).
When running the application and printing to the outout window I see that the process CPU usage is 0%(while the task manager shows 20-30%).
Note that other parameters are OK(for example Virtual memory , Thread count etc.).
This is my code to get all parameters related to devenv.exe:
 private void MonitoringTimer_Tick(object sender, EventArgs e)
 {
     ObjectQuery winQuery = new ObjectQuery("SELECT * FROM Win32_PerfFormattedData_PerfProc_Process WHERE Name = 'devenv'");
     ManagementObjectSearcher searcher = new ManagementObjectSearcher(winQuery);
     foreach (ManagementObject item in searcher.Get())
     {
         string s = "";
         foreach (PropertyData PC in item.Properties)
         {
             if (PC.Value != null)
             {
                 s = PC.Name + " : " + PC.Value.ToString();
             }
             else
             {
                 s = PC.Name + " : NULL";
             }
         }
         s = "******************************************************";
     }
}


Can anyone help me solve this problem?
With best regards,
Eli
AnswerRe: Monitoring Process CPU usage using WMI Pin
Michael Bookatz30-Mar-09 4:00
Michael Bookatz30-Mar-09 4:00 
GeneralRe: Monitoring Process CPU usage using WMI Pin
eli1502197930-Mar-09 18:44
eli1502197930-Mar-09 18:44 
QuestionUnwanted resizing in Button components Pin
roza_gh29-Mar-09 22:27
roza_gh29-Mar-09 22:27 
AnswerRe: Unwanted resizing in Button components Pin
Christian Graus29-Mar-09 22:34
protectorChristian Graus29-Mar-09 22:34 
GeneralRe: Unwanted resizing in Button components Pin
roza_gh29-Mar-09 22:39
roza_gh29-Mar-09 22:39 
GeneralRe: Unwanted resizing in Button components Pin
Christian Graus30-Mar-09 0:28
protectorChristian Graus30-Mar-09 0:28 
GeneralRe: Unwanted resizing in Button components Pin
roza_gh30-Mar-09 0:58
roza_gh30-Mar-09 0:58 
QuestionC# with Ms Access , Crystal Reports and Windows Application. Pin
jimish129-Mar-09 21:44
jimish129-Mar-09 21:44 
AnswerRe: C# with Ms Access , Crystal Reports and Windows Application. Pin
Greg Chelstowski29-Mar-09 23:26
Greg Chelstowski29-Mar-09 23:26 
GeneralRe: C# with Ms Access , Crystal Reports and Windows Application. Pin
jimish130-Mar-09 1:41
jimish130-Mar-09 1:41 
QuestionWhich free Antivirus can remove this: WORM_KLEZ.E Pin
Rao Rafique29-Mar-09 21:34
Rao Rafique29-Mar-09 21:34 
AnswerRe: Which free Antivirus can remove this: WORM_KLEZ.E Pin
Pete O'Hanlon29-Mar-09 21:45
mvePete O'Hanlon29-Mar-09 21:45 
Questionwho killed my app!? [modified] Pin
devvvy29-Mar-09 21:26
devvvy29-Mar-09 21:26 
AnswerRe: who killed my app!? Pin
Pete O'Hanlon29-Mar-09 21:58
mvePete O'Hanlon29-Mar-09 21:58 
QuestionVisual C# 2005 Application Error: Please reply Urgent Pin
Rao Rafique29-Mar-09 21:14
Rao Rafique29-Mar-09 21:14 
AnswerRe: Visual C# 2005 Application Error: Please reply Urgent Pin
SeMartens29-Mar-09 21:28
SeMartens29-Mar-09 21:28 
AnswerRe: Visual C# 2005 Application Error: Please reply Urgent Pin
#realJSOP29-Mar-09 23:45
professional#realJSOP29-Mar-09 23:45 

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.