Get currently used Network Bandwidth with VisualBasic.NET or VJ#

  • Thread starter Thread starter Filip Polsakiewicz
  • Start date Start date
F

Filip Polsakiewicz

Hi all,
I would like to read the currently used bandwidth using VB.NET or VJ#. I
tried using the PerformanceCounter but this one only displays the
available bandwidth and not the used bandwidth. Can anybody point me to
the solution for this problem?

Thanks in advance, Filip
 
You *might* try with System.Management, something along these lines...

Dim a As New System.Management.ManagementObjectSearcher("SELECT
* FROM Win32_PerfFormattedData_Tcpip_NetworkInterface")
Dim b As System.Management.ManagementObject
For Each b In a.Get
MsgBox(b("Property").ToString)
Next

Being "Property" one of these...

http://msdn.microsoft.com/library/d..._perfformatteddata_tcpip_networkinterface.asp

I have not tested this one though. If it does not work, dig a little
deeper into msdn for the WMI classes to see if you find something that
does. Hope it helps.

S
 
Back
Top