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
Marked As Answer by
Reymarx Gereda
MSFT
, Owner
Tuesday, September 15, 2009 1:21 PM
Ali A G
The code in the link ali sent at
http://www.geekpedia.com/tutorial211_Using-Performance-Counters-in-Csharp.html
contain examples in C# on how to use the code.
Reymarx Gereda [MSFT]
Marked As Answer by
motevallizadeh
Wednesday, September 16, 2009 4:15 AM
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).aspx
and
http://www.codeproject.com/KB/dotnet/perfcounter.aspx
and
http://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
Marked As Answer by
Reymarx Gereda
MSFT
, Owner
Tuesday, September 15, 2009 1:21 PM
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 at
http://www.geekpedia.com/tutorial211_Using-Performance-Counters-in-Csharp.html
contain examples in C# on how to use the code.
Reymarx Gereda [MSFT]
Marked As Answer by
motevallizadeh
Wednesday, September 16, 2009 4:15 AM
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
Home
Copyright 2009-2010 by netframeworkdev.com All rights reserved