VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Ping remote machine

Eng. Usama El-Mokadem  (2 Submissions)   Jokes/Humor   Intermediate   Wed 3rd February 2021

Ping remote machine (TCP/IP)

Inputs
IP Address or Hostname

Assumes
Ping remote machine let you know if this machine work or not

Returns
Statues. Fail or Success

API Declarations
Const ICMP_SUCCESS As Long = 0
Const WS_VERSION_REQD As Long = &H101
Const INADDR_NONE = &HFFFF
Type WSADATA
wVersion As Integer
wHighVersion As Integer
szDescription(0 To 256) As Byte
szSystemStatus(0 To 128) As Byte
iMaxSockets As Long
iMaxUDPDG As Long
lpVendorInfo As Long
End Type
Type IP_OPTION_INFORMATION
Ttl As Byte
Tos As Byte
Flags As Byte
OptionsSize As Byte
OptionsData As Long
End Type
Type ICMP_ECHO_REPLY
address As Long
Status As Long
RoundTripTime As Long
DataSize As Long
Reserved As Integer
ptrData As Long
Options As IP_OPTION_INFORMATION
Data As String * 250
End Type
Type HOSTENT
hName As Long
hAliases As Long
hAddrType As Integer
hLength As Integer
hAddrList As Long
End Type
Declare Function WSAStartup Lib "WSOCK32.DLL" (ByVal wVersionRequired As Long, lpWSADATA As WSADATA) As Long
Declare Function WSACleanup Lib "WSOCK32.DLL" () As Long
Declare Function inet_addr Lib "WSOCK32.DLL" (ByVal cp As String) As Long
Declare Function IcmpCreateFile Lib "icmp.dll" () As Long
Declare Function IcmpSendEcho Lib "icmp.dll" _
(ByVal IcmpHandle As Long, _
ByVal DestinationAddress As Long, _
ByVal RequestData As String, _
ByVal RequestSize As Long, _
ByVal RequestOptions As Long, _
ReplyBuffer As ICMP_ECHO_REPLY, _
ByVal ReplySize As Long, _
ByVal Timeout As Long) As Long
Declare Function IcmpCloseHandle Lib "icmp.dll" (ByVal IcmpHandle As Long) As Long
Declare Function gethostbyname Lib "ws2_32.dll" (ByVal host_name As String) As Long
Declare Function inet_ntoa Lib "ws2_32.dll" (ByVal inn As Long) As Long
Declare Sub RtlMoveMemory Lib "kernel32" (hpvDest As Any, ByVal hpvSource As Long, ByVal cbCopy As Long)

Rate Ping remote machine (3(3 Vote))

Download Ping remote machine

Ping remote machine Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters