<HTML>
<HEAD>
<TITLE>PING IP CONSOLE</TITLE>
<style>
.term {
font-size: 16;
font-family: arial;
color: white;
background-color: black;
font-weight: bold
}
</style>
</HEAD>
<BODY class=term>
<FORM METHOD=GET ACTION=ping.asp>
C:\>ping <INPUT class=term style="border: 0" TYPE=TEXT NAME=IPadd VALUE="<% = Server.HTMLEncode(Request("IPadd")) %>">
</FORM>
<%
IP = Request.QueryString("IPadd")
IF IP="" Then
Response.end
else
PingIP()
End if
Function PingIP()
Set WShShell = Server.CreateObject("WScript.Shell")
Result = WShShell.Run("e:\work\PingASP.bat " & IP, 7, TRUE)
if Result = 0 Then
Set FileSys = Server.CreateObject("Scripting.FileSystemObject")
Set TextFile = FileSys.OpenTextFile("e:\Tmp.txt", 1)
TextBuffer = TextFile.ReadAll
Response.write "<PRE STYLE='font-family: Lucida Console;font-size: 14;font-weight: bold'>" & TextBuffer & "</PRE>"
TextFile.Close
FileSys.DeleteFile "e:\Tmp.txt"
else
Response.write "Error"
end if
End Function
%>
</BODY>
</HTML>