Performance Counter not working

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I wrote an application in c# .net 2.0. The application monitors the network
speed of a networkinterface. If I install the application at another pc with
the .net framework installed, the application won't run. The performance
counter can initialize itself but the value of bytes recieved for example is
always 0.

What should I do? Thanks
 
Do you have administrative access to the machine? If you're creating a
custom counter you need to have administrative access to the machine.

Can you post the code you're using for this?

Dave
 
PCounter = new PerformanceCounter("Network Interface", "Bytes
Received/sec",networkInterfaceName);

To get the values I use the following every second:

PCounter.NextSample().RawValue;

But the last statement is always 0, if i install the application at another
pc. I checked if the other person has administrative access, and he also had.
 
Back
Top