سؤال

I'd like my application to be able to monitor how much data (I don't need the actual packages, only amount of bytes) that goes in an out of the computer (on a single interface) at all time, and also over time. In other words; I want to be able to show a number displaying current up and down speed (for instance 5kB/s) as well as a graph over the last 5 minutes, and lastly I also want to be able to show a correct amount of data that has gone out/in of the interface in the last hour.

Is this doable in a simple manner? I don't mind using third-party assemblies, or having to write my own wrapper around some win32 api, however; said third-party assemblies must be able to be used with open-source applications and must not cost money.

هل كانت مفيدة؟

المحلول

In fact you may easily get all network traffic using performance counters, but I do not know any way to measure network traffic of your application than opening each packet and reading it. To measure all network traffic, refer to the following:network traffic in c#

نصائح أخرى

Something like DUMeter?

Look here .

You might want to look at performance counters.

Screen shot from perfmon

On most of these network counters you can choose the network interface that is to be monitored. You can do the same in .Net code as well.

Here's a CodeProject article that contains a forms app that does basically what you're after: http://www.codeproject.com/Articles/6259/Monitoring-network-speed

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top