Network Monitor, 0.7 - 19 March 2009
[download: binaries | sources]
Would you mind sharing your code? I am trying to utilize a less cpu intensive method of calculating network utilization than performance counters.
No problem, see the link in the post.It uses the GetIfEntry() from IPHLAPI.DLL - I remember I took the code a while ago from somewhere and change it slightly. Now I just noticed there is a GetIfEntry2() that supports ULONG64 return values in MIB_IF_ROW2 structure, that might be quite useful as the other one only supported DWORDs.http://msdn.microsoft.com/en-us/library/aa365939(VS.85).aspxhttp://msdn.microsoft.com/en-us/library/aa365941(VS.85).aspxIf you do anything on that, please do share.
Thanks... I found another method as well in my looking. I am going to play around with both to see which is the most efficient as performance counters definitely are not.
I believe the GetIfEntry() entry method is used by Task Manager as well, for it's Network tab, it seems to be very low on resources. I couldn't even find any performance counters to read the number of transfered bytes.
Thanks for this! Exactly what I needed to look at after fiddling with performancecounters that only do an unreliable speed grab.
Thanks David, if you happen to enhance it to work with ULONG64s, please do share.
hey this is viv here ..........thanks for your worthy code, i want to write code to calculate the total bytes sent and received for the whole day and to store that data in a database as a record of it.
if u could send a mail to me here is my email firstname.lastname@example.org
Then you can probably use some of my code and put it in a service program - no idea how to write one, although there are tools out there that can make any app into a service, but obviously your app won't respond properly to service calls like Stop and it will get simply killed...