Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pinging from ASP

Status
Not open for further replies.

Michael42

Programmer
Oct 8, 2001
1,454
0
0
US
How can I ping an IP number or DNS from ASP and return the results of whether it was sucessful or not?

Thanks for your time!
 
These components look realy good. Thanks. I may end up opting for them.

Is there anyway you can "detect" if a web page is available using native ASP?

Thanks again!
 
Here's a script I got from ASPFAQ.com:

<% Response.Buffer = true %>
<%
url = &quot;
Set objWShell = CreateObject(&quot;WScript.Shell&quot;)
Set objCmd = objWShell.Exec(&quot;ping &quot; & url)
strPResult = objCmd.StdOut.Readall()
set objCmd = nothing: Set objWShell = nothing

strStatus = &quot;offline&quot;
if InStr(strPResult,&quot;TTL=&quot;)>0 then strStatus = &quot;online&quot;

response.write url & &quot; is &quot; & strStatus
response.write &quot;.<br>&quot; & replace(strPResult,vbCrLf,&quot;<br>&quot;)
%>

There are also scripts for XP and .NET on this page,
Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top