![]() |
|
[.NET] Bandwidth Monitor - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] Bandwidth Monitor (/showthread.php?tid=4371692) |
Bandwidth Monitor - iKQLY - Aug 1, 2014 Just made a mini bandwidth monitor. It's pretty shitty not gonna lie but it works. It tracks current download/upload speeds, total bandwidth (since computer startup), and total bandwidth since reset. There is an option to add to startup so it can automatically collect bandwidth data at all times. You can also remove from start up easily. *Remember to run program as admin before clicking 'add to startup' button Right now it only takes the bandwidth data from the largest/most used network adapter. I could make it so it measures bandwidth individually on each adapter but I don't think it's really necessary. You can chose which day of the month you want a reset and it gets saved. Any values saved in this program is just stored in a text file, didn't feel like serializing or using a database of any sort. Felt it was sufficient. Image:Spoiler (Click to View) Source:Spoiler (Click to View) Application Only:Spoiler (Click to View) * - TheBarret - Aug 1, 2014 Whackzor, what interval did ya use for the reading , and where do you query the info, directly from the register or from the ManagementObjectSearcher ? * - iKQLY - Aug 1, 2014 (Aug 1, 2014 09:19 AM)TheBarret Wrote: Whackzor, what interval did ya use for the reading , and where do you query the info, directly from the register or from the ManagementObjectSearcher ? Just used performance counters for the current download/upload speeds. Couldn't find any performance counters for total bandwidth. To get total bandwidth, I looped through each NetworkInterface in NetworkInterface.GetAllnetworkInterfaces. Then I grabbed the IPv4stats using NetworkInterface.GetAllNetworkInterfaces Then for each ipv4stats object, I called ipstats.BytesReceived. I then chose the NetworkInterface (or networkcard) with the largest IPv4stats.BytesReceived value. I've never used ManagementObjectSearcher so I'm not exactly sure how to use it * - iSpy- - Aug 1, 2014 Thanks man, everything that people think is shit others can learn from, thanks for the source * - SIM-1179501 - Aug 1, 2014 Actually looks pretty nice. I will test it out. * - ShizzleFly - Aug 1, 2014 Ooh nice! Thanks ;) Gonna test it out. ^^ |