Connection Speed in Kbps or Mbps?

Is there a way I could show the speed of the connection in Mbps or Kbps

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Label1.Text = ( Connection Speed )
End Sub



Answer this question

Connection Speed in Kbps or Mbps?

  • sunny123

    yeah, can somone convert that C# code to VB..



  • powerteh

    Sorry didnt explain very well but the second 1 was what I was looking for thanks.

    Is there a way to do it in VB or convert that C# code


  • Fusion54

    Wow you just totally confused me remember im 13...

    Simple English please.


  • LittleSettler

    ermm... the link bandwidth (ie 100 or 10 Mbps on Ethernet interfaces) or the real internet connection bandwith

    For the firts see this: http://www.codeguru.com/csharp/csharp/cs_network/configurationfilesinis/article.php/c9061/

    For the second see this : http://www.codeproject.com/csharp/NetworkMonitorl.asp

    Regards.


  • ShEi

    If you see the C# code ... will see how re-write it in VB.NET ;)

    C# and VB.NET are diferents ways two use the same base class library an same CLR, using the same classes.

    Regards.



  • davidwii

    Alex2200 wrote:
    Sorry didnt explain very well but the second 1 was what I was looking for thanks.

    Is there a way to do it in VB or convert that C# code

    C# to VB and vice versa online Converter:

    http://www.developerfusion.co.uk/utilities/convertvbtocsharp.aspx



  • ChrisSmith

    Maybe this will help but you will have to download the project from codeproject ( link 2 above) to get the network library...

    MP

    Private adapters As NetworkAdapter()
    Private monitor As NetworkMonitor

    Sub GetNetworkMonitor()
    monitor = New NetworkMonitor
    Me.adapters = monitor.Adapters

    If adapters.Length = 0 Then
    Me.ListAdapters.Enabled = False
    MessageBox.Show("No network adapters found on this computer.")
    Return
    End If

    Me.ListAdapters.Items.AddRange(Me.adapters)
    End Sub

    Private Sub NetMonitor_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    GetNetworkMonitor()
    End Sub

    Private Sub ListAdapters_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListAdapters.SelectedIndexChanged
    monitor.StopMonitoring()
    monitor.StartMonitoring(adapters(Me.ListAdapters.SelectedIndex))
    Me.TimerCounter.Start()
    End Sub

    Private Sub TimerCounter_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles TimerCounter.Tick
    Dim adapter As NetworkAdapter = Me.adapters(Me.ListAdapters.SelectedIndex)
    Me.LableDownloadValue.Text = [String].Format("{0:n} kbps", adapter.DownloadSpeedKbps)
    Me.LabelUploadValue.Text = [String].Format("{0:n} kbps", adapter.UploadSpeedKbps)
    End Sub
    End Class


  • ShAdeVampirE

    you need to be more specific than that

    what connection speed

    where is this connection coming from

    how are you obtaining this connection speed



  • Connection Speed in Kbps or Mbps?