I am new to VB.NET and I want to implement a timer function into a PING, below is the code which I am using to PING an ip address. I want the PING to be executed something like every 10 seconds, so that it updates a lablel.
Any ideas how to do this?
Dim ping As New System.Net.NetworkInformation.Ping
Dim options As New System.Net.NetworkInformation.PingOptions
options.DontFragment = True
Dim data As String = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
Dim buffer As Byte() = System.Text.Encoding.ASCII.GetBytes(data)
Dim pingreply As System.Net.NetworkInformation.PingReply
Dim a() As Byte = {CInt(192), CInt(168), CInt(I0), CInt(5)}
Dim IP As New System.Net.IPAddress(a)
pingreply = ping.Send(IP, 120, buffer, options)
If pingreply.Status.ToString = "TimedOut" Then