Working with PING in VB.NET



Pinging the system from Network

 'Delcare Ping oject 
    Dim ping As New System.Net.NetworkInformation.Ping
    'create timer event 
    Private WithEvents pTimer As New Timer
    'Set timer interval and start timer in form load
    Private Sub frm_Load(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles Me.Load
        pTimer.Interval = 1000
        pTimer.Enabled = True
        pTimer.Start()
    End Sub
    'Fire the timer event
    Private Sub pTimer_Tick(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles pTimer.Tick
        'Display Ping message in textbox
        txtSyntaxHelp.Text &= ping.Send("10.5.11.134").Status.ToString & vbCrLf
    End Sub

Share |

 Cant find the page you are looking for?
 Help us to improve by adding the content that you are looking for.
 Leave a feedback
 We look forward to hear your comments and feedback.