27 | 07 | 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
        Else
            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
Login

Sign up now and upload your code to the website.

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