.NET Framework Bookmark and Share   
 index > Network Class Library (System.Net) > calculate bandwidth
 

calculate bandwidth

hi
Is there any way i can calculate bandwidth (packets sent and received) by an exe/application via net?
Thanks Motevallizadeh
motevallizadeh
You can consume perfmon counters in c# code and look at the values in realtime:http://www.geekpedia.com/tutorial211_Using-Performance-Counters-in-Csharp.html

Hope this helps
Ali A G
The code in the link ali sent athttp://www.geekpedia.com/tutorial211_Using-Performance-Counters-in-Csharp.html contain examples in C# on how to use the code.

Reymarx Gereda [MSFT]
Reymarx Gereda
Yes you can use the .NET Performance counter which list the number of bytes sent/received and also the number of datagrams sent and received per .NET application and also for all .NET applications running on a machine. You can learn more about perfmon counters have a look at:http://msdn.microsoft.com/en-us/library/aa373083(VS.85).aspxandhttp://www.codeproject.com/KB/dotnet/perfcounter.aspxandhttp://www.c-sharpcorner.com/UploadFile/stuart_fujitani/NETandPredefinedCLRPerformanceCountersPartI12022005000727AM/NETandPredefinedCLRPerformanceCountersPartI.aspx

Hope this helps.
Ali A G
I want to use this in my c# application not in windows counter

Thanks Motevallizadeh
motevallizadeh
You can consume perfmon counters in c# code and look at the values in realtime:http://www.geekpedia.com/tutorial211_Using-Performance-Counters-in-Csharp.html

Hope this helps
Ali A G
thanks AliAG
if i want to write this counter in c# how i can ?
can you send me some references?

Thanks Motevallizadeh
motevallizadeh
The code in the link ali sent athttp://www.geekpedia.com/tutorial211_Using-Performance-Counters-in-Csharp.html contain examples in C# on how to use the code.

Reymarx Gereda [MSFT]
Reymarx Gereda

You can use google to search for other answers

Custom Search

More Threads

• Bi-directional communiication
• Send email on behalf of another user?
• DNS - Host Not Found
• sending SMS
• SocketAsyncEventArgs.BytesTransferred accumulates to 24820 when SendAsync is completed without receiver
• Unable to send email using Dynamic IP
• Read Client Packet
• UDP Multicast Dgram size question
• Socket programming in Web services
• C sharp code to close TCP connection established by any process