Ping an ip address remotely by ASP





3
Date Submitted Wed. Jul. 15th, 2009 1:54 AM
Revision 1 of 1
Scripter Cloudgen
Tags address | ASP | IP | Ping | VBSCRIPT
Comments 0 comments
This VBScript provides the functionality for ping an ip address remotely by an IIS server. This file require IIS to access the ping.exe. see How can a ping an ip address remotely by ASP

<%
 url = Trim(Request("ip"))
if url<>"" Then
        Set objWShell = CreateObject("WScript.Shell")
        Set objCmd = objWShell.Exec("ping " & url)
        strPResult = objCmd.StdOut.Readall()
        set objCmd = nothing: Set objWShell = nothing
 
        strStatus = "offline"
        if InStr(strPResult,"TTL=")>0 then strStatus = "online"
 
        response.write  strStatus
End If
%>
 

Comments

There are currently no comments for this snippet.

Voting

Votes Down