Click here to Skip to main content
15,896,606 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to create an Type from string Pin
Corinna John7-May-04 7:31
Corinna John7-May-04 7:31 
GeneralRe: How to create an Type from string Pin
cyonite7-May-04 13:39
cyonite7-May-04 13:39 
GeneralRe: How to create an Type from string Pin
Corinna John7-May-04 23:29
Corinna John7-May-04 23:29 
GeneralRe: How to create an Type from string Pin
cyonite8-May-04 4:58
cyonite8-May-04 4:58 
AnswerRe: How to create an Type from string Pin
Heath Stewart7-May-04 9:25
protectorHeath Stewart7-May-04 9:25 
GeneralRe: How to create an Type from string Pin
cyonite7-May-04 13:42
cyonite7-May-04 13:42 
GeneralRe: How to create an Type from string Pin
Heath Stewart8-May-04 19:10
protectorHeath Stewart8-May-04 19:10 
GeneralPerformanceCounter problem Pin
bgd16087-May-04 5:50
bgd16087-May-04 5:50 
HI!

I want to detect CPU usage and Net speed using PerformanceCounter, but the vaules are always 0.

For net speed here is the code:

private void GetNetSpeed()
{
PerformanceCounterCategory category = new PerformanceCounterCategory("Network Interface");

foreach(string adapter in category.GetInstanceNames())
{
if(adapter == "MS TCP Loopback interface")
continue;
PerformanceCounter netRCounter = new PerformanceCounter("Network Interface","Bytes Received/sec",adapter);
PerformanceCounter netSCounter = new PerformanceCounter("Network Interface","Bytes Sent/sec",adapter);
txtSys.Text += "Recived: " + netRCounter.NextValue().ToString() + " b/s.";
txtSys.Text += "Sent: " + netSCounter.NextValue().ToString() + " b/s.";
}
}

Could anybody tell me way is always 0?

HELLO!
Generalexcel Pin
dcronje7-May-04 5:40
dcronje7-May-04 5:40 
GeneralRe: excel Pin
Heath Stewart7-May-04 9:23
protectorHeath Stewart7-May-04 9:23 
GeneralFunctions and references Pin
surgeproof7-May-04 5:38
surgeproof7-May-04 5:38 
GeneralRe: Functions and references Pin
Heath Stewart7-May-04 9:16
protectorHeath Stewart7-May-04 9:16 
GeneralRe: Functions and references Pin
surgeproof7-May-04 23:16
surgeproof7-May-04 23:16 
GeneralRe: Functions and references Pin
Heath Stewart8-May-04 19:20
protectorHeath Stewart8-May-04 19:20 
GeneralRe: Functions and references Pin
surgeproof10-May-04 4:50
surgeproof10-May-04 4:50 
GeneralWorking with XML file Pin
Alex Getman7-May-04 5:35
Alex Getman7-May-04 5:35 
GeneralRe: Working with XML file Pin
TigerNinja_7-May-04 8:35
TigerNinja_7-May-04 8:35 
GeneralSystem.Drawing Problem Pin
Russell Jones7-May-04 4:29
Russell Jones7-May-04 4:29 
GeneralRe: System.Drawing Problem Pin
Mike Dimmick7-May-04 4:48
Mike Dimmick7-May-04 4:48 
GeneralRe: System.Drawing Problem Pin
Heath Stewart7-May-04 4:51
protectorHeath Stewart7-May-04 4:51 
GeneralRe: System.Drawing Problem Pin
Russell Jones10-May-04 3:33
Russell Jones10-May-04 3:33 
GeneralString Pin
bertcox7-May-04 3:17
bertcox7-May-04 3:17 
GeneralRe: String Pin
Heath Stewart7-May-04 3:31
protectorHeath Stewart7-May-04 3:31 
GeneralRe: String Pin
Jeff Varszegi7-May-04 4:20
professionalJeff Varszegi7-May-04 4:20 
GeneralRe: String Pin
Heath Stewart7-May-04 4:25
protectorHeath Stewart7-May-04 4:25 

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.