| Ping Server Connection .NET |
|
|
|
| Tutorials | |||
|
Use VB.NET to check a server connection. Try the Ping Function [code] 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
[/code]
|


