Dim IPs As System.Net.IPAddress() = System.Net.Dns.GetHostAddresses(DNS) For Each IP As System.Net.IPAddress in IPs ListBoxPing.Items.Add("Ping from " & TextBoxPing.Text & " (IP:" & IP.ToString & ")" & _ " = " & GetPing(TextBoxPing.Text) & " ms") Next
Dim IPs As System.Net.IPAddress() = System.Net.Dns.GetHostAddresses(DNS) If IP.length > 0 Then ListBoxPing.Items.Add("Ping from " & TextBoxPing.Text & " (IP:" & IP(0).ToString & ")" & _ " = " & GetPing(TextBoxPing.Text) & " ms") End If
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim sw As New Stopwatch If My.Computer.Network.Ping("192.168.1.240") Then sw.Start() My.Computer.Network.Ping("192.168.1.240") sw.Stop() Button3.Text = "elapsed time: " & (sw.ElapsedMilliseconds) & "ms" Else MsgBox("request timeout") Button3.Text = " Elapsed Time Not Available" End If End Sub