is it possible to monitor the amount of download/upload of the network with .NET classes? how about with windows APIs? anyone knows how I can do this?:rolleyes:
Printable View
is it possible to monitor the amount of download/upload of the network with .NET classes? how about with windows APIs? anyone knows how I can do this?:rolleyes:
You could look into performance counters, maybe there is a way to get performance counters by process (your .NET app). I'm on the way out the door or I'd look into it also...
There is definately a way, I just haven't found it yet... Are you talking like when you double click the little network icon down in the system tray it shows the outgoing and incomming totals?
yeah exactly:) but stupid windows doesnt usually tell you the amount transferred in bytes. Its unit is in BLOCKS on my comp.... I'll take a look at the performance counterQuote:
Originally posted by hellswraith
There is definately a way, I just haven't found it yet... Are you talking like when you double click the little network icon down in the system tray it shows the outgoing and incomming totals?
This looks like what you want:
ms-help://MS.VSCC/MS.MSDNVS/cpgenref/html/gngrfnetworkingperformancecounters.htm
tracks bytes rec'd/sent.
aah thanks alot :) I'll have to do a little research before I can use it though:D I have no clue how to use a performanceCounter:eek:Quote:
Originally posted by Slow_Learner
This looks like what you want:
ms-help://MS.VSCC/MS.MSDNVS/cpgenref/html/gngrfnetworkingperformancecounters.htm
tracks bytes rec'd/sent.
umm one thought: I have to specify an instance name for the performance counter. I'm currently choosing this in design time. The instance name is my network card. The problem with this is that some other machine would have a different network card. I don't think this would work on another machine then
The category that I chose is Networking Interface, with the "Bytes Sent/sec" counter. There are these three instances to choose from:
-Linksys LNE100TX Fast Ethernet Adapter[LNE100TX v4] - Packet Scheduler Miniport
-MS TCP Loopback interface
-Microsoft TV_Video Connection
the first one if my network card. Would the second chose appear on every PC? or would I have to prompt the user with a list of available "instances" and ask the user to choose the correct one?:confused:
You could do what other network monitor programs I've used do: enumerate all installed interfaces, and total ALL of their network traffic, or allow the user to select one.
HMM, I wanna monitor upload/download, so that means I'll have to make 6 performance counters :DQuote:
Originally posted by Slow_Learner
You could do what other network monitor programs I've used do: enumerate all installed interfaces, and total ALL of their network traffic, or allow the user to select one.
I dont understand. isnt all the network traffice supposed to go through the network card? what are the other two that are listed there?:rolleyes:
Those are other "network adapter" drivers that are also installed. The Loopback Adapter is a software-only set of hooks that is usually installed in the absence of a hardware network adapter, in order to allow you to install networking components and have them still work (it's installed on mine for example so I can run MSDE while not dialed up, because I only have a modem).
The other one I don't know, it may be part of Windows XP's networking components.
Here are the walkthroughs for performance counters:
ms-help://MS.VSCC/MS.MSDNVS/vbcon/html/vboriperformancecounterwalkthroughs.htm
These show retrieving and displaying performance counters programatically, at runtime, instead of using the the dragdrop component.
Duh, I also attached a very generic drag/drop performance counter demo from the Sam's VB.NET in 21 days book.
thanks for your help Slow_Learner. That MSDN article tells me how to receive the categories and the counter names, but I have no idea how to receive a list of instances. Is it even possible? there seems to be no way to do this:confused: :confused: :confused: any ideas?
The link doesn't work. Can someone plz give me the correct link, or at least a brief guide on how to monitor the daily internet traffic on my PC? (vb 2005)Quote:
ms-help://MS.VSCC/MS.MSDNVS/vbcon/html/vboriperformancecounterwalkthroughs.htm
Thank you