Mediante este código obtengo los bytes enviados y recibidos por la red.
Código
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) _ Handles Timer1.Tick Dim nics As System.Net.NetworkInformation.NetworkInterface() nics = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces() For Each nic As NetworkInterface In nics Dim S As Integer = nic.NetworkInterfaceType If nic.OperationalStatus = 1 Then If S = NetworkInterfaceType.Wireless80211 Or S = NetworkInterfaceType.Ethernet Then Dim ipv4Stats As System.Net.NetworkInformation.IPv4InterfaceStatistics ipv4Stats = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces.First.GetIPv4Statistics Label1.Text = String.Format("Enviado: {0} bytes", ipv4Stats.BytesSent.ToString("##,##")) Label2.Text = String.Format("Recibido: {0} bytes", ipv4Stats.BytesReceived.ToString("##,##")) End If If S = NetworkInterfaceType.Ppp Then Dim ipv4Stats As System.Net.NetworkInformation.IPv4InterfaceStatistics ipv4Stats = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces(1).GetIPv4Statistics Label1.Text = String.Format("Enviado: {0} bytes", ipv4Stats.BytesSent.ToString("##,##")) Label2.Text = String.Format("Recibido: {0} bytes", ipv4Stats.BytesReceived.ToString("##,##")) End If End If Next End Sub
Pero no cuadra con los mostrados por Windows a través del cuadro "Estado de Conexión de red inalámbrica":
Gracias