Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


[VB.NET]Ping an IP with Response Time filter_list
Author
Message
[VB.NET]Ping an IP with Response Time #1
Alright, so lets add to our form: 2 Labels, 2 TextBox Controls and 1 Button. Make your form look something along the lines of this:
[Image: o5U1HmC.png]

View the code for your project, and paste this function in:
Code:
Public Function Ping(ByVal server As String) As String
        Dim ElapseTime As New Stopwatch
        ElapseTime.Start()
        My.Computer.Network.Ping(server)
        ElapseTime.Stop()
        Return ElapseTime.Elapsed.TotalSeconds.ToString("N")
    End Function

Go back to your design, double click your button and paste this code:
Code:
TextBox2.Text = Ping(TextBox1.Text) & " Seconds"

If you did it correct, you should see something like this:
[Image: DOF8d4I.png]
(This post was last modified: 07-17-2013, 11:50 PM by Dismas.)
[Image: GiXvY27.png]

Reply

RE: [VB.NET]Ping an IP with Response Time #2
I think it should be 0.33 Secs and not 0.33 MS.
But good work Smile
[Image: tumblr_m4vms28lYu1qj3ir1.gif]

Reply

RE: [VB.NET]Ping an IP with Response Time #3
Oh, whoops. Thanks for pointing that out Smile
[Image: GiXvY27.png]

Reply







Users browsing this thread: 2 Guest(s)