Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Public Shared Function GetPingMs(ByRef hostNameOrAddress As String)
- Dim ping As New System.Net.NetworkInformation.Ping
- Return ping.Send(hostNameOrAddress).RoundtripTime
- End Function
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
- If My.Computer.Network.IsAvailable Then
- Dim a As String
- a = GetPingMs(TextBox2.Text)
- Dim tb2 As String = " ( " + TextBox2.Text + " ) = "
- Try
- RichTextBox1.AppendText(Environment.NewLine + "Response time -" + tb2 + "" + a)
- Catch ex As InvalidCastException
- End Try
- Else
- MsgBox("No network")
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement