Ping ActiveX Control
Use the Ping control to easily send and receive ICMP echo (Ping) messages. Dynamically discovers if a host is reachable. Features include:
- Determine if any host is online and reachable.
- Simple interface makes the Ping control easy-to-use.
- Ping a host using blocking or non-blocking techniques.
- Specify any amount of data to send along with the Ping packet.
- Assign an ID to the Ping packet.
Looking for the .NET version of this control?
- Visual Studio .NET (.NET Framework)
- Visual Basic (VB)
- Visual C++ (VC++)
- C++ Builder
- ASP (requires the ASP user to have permission to use raw sockets; see Ping Enterprise for a control that does not have this requirement)
- Office 97/2000
||Use the Ping Control to determine if a host is reachable.
||Optional data that is sent and returned with each ping request.
||Time between sending the ping request and receiving the response (round-trip time in milliseconds).
||Sets the ping request ID included with the request.
||Controls the blocking behavior of methods that can be used in blocking and non-blocking ways.
||Abort any blocking method and release all system resources.
||Show the About Box.
||Determine if a host is reachable.
||Fires when an error condition occurs.
||Fires after the Id, Delay, and Data properties are updated with the contents of a ping response.
How easy is the Ping ActiveX component to use? Check out the following Ping VB example below, which demonstrates getting an IP address for a domain name.
On Error GoTo OnError ' use intrinsic error handling
Dim Count As Integer
Dim Delay As Integer
Ping1.Timeout = 10000 'give it 10 seconds to complete
Delay = 0
' Ping a host 3 times.
For Count = 1 To 3
Delay = Delay + Ping1.Delay
' take the average time
Delay = Delay / Count
MsgBox "Server is reachable, average delay " & Delay & " ms"
OnError: ' Any error jumps here
Debug.Print "ERROR #" + CStr(Err.Number) + ": " + Err.Description