README.md
December 4, 2022 · View on GitHub
Description
Like (Ping) IP address
More Info
| Submitted On | |
| By | Petko Petkov |
| Level | Intermediate |
| User Rating | 4.9 (112 globes from 23 users) |
| Compatibility | VB 5.0, VB 6.0 |
| Category | Internet/ HTML |
| World | Visual Basic |
| Archive File |
Source Code
Private Type QOCINFO
dwSize As Long
dwFlags As Long
dwInSpeed As Long 'in bytes/second
dwOutSpeed As Long 'in bytes/second
End Type
Private Declare Function IsDestinationReachable Lib "SENSAPI.DLL"
Alias "IsDestinationReachableA" (ByVal lpszDestination As String,
ByRef lpQOCInfo As QOCINFO) As Long
Private Sub Form_Load()
Dim Ret As QOCINFO
Dim IP As String
Ret.dwSize = Len(Ret)
'Put desired IP
IP = "217.9.238.114"
If IsDestinationReachable(IP, Ret) = 0 Then
MsgBox "The destination cannot be reached!"
Else
MsgBox "The destination can be reached!" +
vbCrLf + _
"The speed of data coming in from the destination
is " + Format$(Ret.dwInSpeed / 1048576, "#.0") + " Mb/s,"
+ vbCrLf + _
"and the speed of data sent to the destination
is " + Format$(Ret.dwOutSpeed / 1048576, "#.0") + " Mb/s."
End If
End Sub