|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| 10/12/2009 at 01:40AM PDT, ID: 24803900 | Points: 500 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: |
ajaxPing.asp
<%
response.Expires = -1
Set ShellObject = CreateObject("WScript.Shell")
Set CommandObject = ShellObject.Exec("ping " & Request("Address"))
PingResult = CommandObject.StdOut.Readall()
If InStr(PingResult,"TTL=") > 0 Then
MyResponse = "Success"
Else
MyResponse = "Fail"
End If
Response.Write(MyResponse & "<br /><br />" & Replace(PingResult, vbCrLf , "<br>"))
%>
Main Page :
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<script>
ajaxFunctionRef = 0
function RunPing(SiteAddr) {
SaveURL = "ajaxPing.asp?address="+SiteAddr
var xmlHttp;
try {xmlHttp=new XMLHttpRequest();}
catch (e) { try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e) { try {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch (e) { alert("Your browser does not support AJAX!");
return false;
}}}
xmlHttp.onreadystatechange=function()
{ if(xmlHttp.readyState==4) {
// Ajax Response Code - use xmlHttp.responseText for returned response.Write() commands
try {
document.getElementById("output").innerHTML = xmlHttp.responseText
} catch (e) {alert('Sorry, there is an error in the AJAX Response.\n\nError Description : ' + e.description);
document.getElementById("output").innerHTML = xmlHttp.responseText;
}
}}//End Response Function');
xmlHttp.open("GET",SaveURL,true);
xmlHttp.send(null);
}
function RunPing2(SiteAddr) {
SaveURL = "ajaxPing.asp?address="+SiteAddr
var xmlHttp2;
try {xmlHttp2=new XMLHttpRequest();}
catch (e) { try { xmlHttp2=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e) { try {xmlHttp2=new ActiveXObject("Microsoft.XMLHTTP");}
catch (e) { alert("Your browser does not support AJAX!");
return false;
}}}
xmlHttp2.onreadystatechange=function()
{ if(xmlHttp2.readyState==4) {
// Ajax Response Code - use xmlHttp.responseText for returned response.Write() commands
try {
document.getElementById("output").innerHTML = xmlHttp2.responseText
} catch (e) {alert('Sorry, there is an error in the AJAX Response.\n\nError Description : ' + e.description);
document.getElementById("output").innerHTML = xmlHttp2.responseText;
}
}}//End Response Function');
xmlHttp2.open("GET",SaveURL,true);
xmlHttp2.send(null);
}
</script>
<div style="width:500px; height:200px; border:1px solid #cccccc;">
<div style="margin:3px; float:left; padding:4px; border:1px solid #cccccc" onclick="RunPing('192.168.1.1');RunPing2('localhost');">Ping</div>
</div>
<div id="output"></div>
</body>
</html>
|
Advertisement