Ok, need to ask because this is driving me nuts now.
\r\n
\r\nI have a performance counter set up to pull % Processor Time on a remote machine.
\r\n
\r\nHeres the code I use to pull it:
\r\n
\r\n
Code:
\r\n
Private cpuCounter As PerformanceCounter = Nothing\r\n\r\n\r\nTry\r\n cpuCounter = New PerformanceCounter("Processor", "% Processor Time", "_Total", strServer)\r\n Catch ex As Exception\r\n MessageBox.Show(ex.Message)\r\n End Try
\r\n
\r\nHowever, sometimes it can take 40-50 seconds for this one counter to process.. when its been created (the \'cpuCounter =\' line), then it runs just fine, I can pull nextvalue without any problem.. but creating it takes forever.
\r\n
\r\nThis only happens the first time I run my program and it only happens with the first counter, and it doesn\'t ALWAYS happen.
\r\n
\r\nAny idea how I can try and track down whats holding me up here? All the other counters are fine, its just the first one.. am I missing some log-in step or something?
\r\n
\r\nThanks
\r\n \r\n\r\n