20 | 09 | 2017

Ping Server Connection .NET

Use VB.NET to check a server connection. Try the Ping Function

Function PingServer(ByVal Address As String) As Boolean
        '**** Code from VisibleVisual.com ****
        If My.Computer.Network.Ping(Address, 1000) Then
            PingServer = True
            PingServer = False
        End If
    End Function
    Sub TestPingFunction()
        Dim rtrn As Boolean
        rtrn = PingServer("www.google.com")
        If rtrn = False Then
            MsgBox ("Ping request timed out.")
        ElseIf rtrn = True Then
            MsgBox ("Server pinged successfully.")
        End If
    End Sub

Sign up now and upload your code to the website.

Help us to continue.....
Articles View Hits
Latest Articles