|
ping Hosts
This uses the ping component from components2go . This component
is freeware . You can download this component here
. Enter the code below once you have installed the exe file.
Code:
<%
'declare our variables
Dim objPing
'create an instance of the object
Set objPing = Server.CreateObject("c2g.ping")
'if the ping is successful then display some information
if objPing.Ping("www.phpin.com") Then
Response.Write "success" & "<br>"
Response.Write "times are as follows"
Response.Write "Minimum time is " & objPing.Minimum
& "ms<br>"
Response.Write "Maximum time is " & objPing.Maximum
& "ms<br>"
Response.Write "Average time is " & objPing.Average
& "ms<br>"
'else display the error that occured
Else
Response.Write " An error occured" & "<br>"
Response.Write objPing.LastError
End If
'destroy the object
Set objPing = Nothing
%>
|