JScript Sample: jscript/general/process/proc.asp
   ASP Script
   Comments or Client-side Script
   HTML and Text

<%@language=jscript%>
<html>
<head><title> Windows NT Task Manager </title><head>
<body bgcolor=white text=black>
<blockquote>
<h2><p align="center">Windows NT Task Manager</p></h2>
<p> <font color = red size = +2> Warning: </font></p>
<p> <font color=red size=+1> Selecting one of the Process IDs below will cause the server to attempt to <b>terminate</b> the selected process. Make sure you know what you are doing!</font></p>
<hr>
<p>

<% 
   var idArray,nameArray,timeArray,sizeArray;
   ProcList = Server.CreateObject("halcyon.demo.Proc")
   if (Session("host") == ""){
       Session("host") = Request.form("host")
      Session("port") = Request.form("port")
      Session("userid") = Request.form("userid")
      Session("password") = Request.form("password")
   }
   host = Session("host")
   port = Session("port")
   uid = Session("userid")
   pwd = Session("password")
   adapter = "halcyon.rjax.comm.TCPClientAdapter"
   ProcList.init( host, port, uid, pwd, adapter)

   idArray = ProcList.GetProcessIDs
   nameArray = ProcList.GetProcessNames
   timeArray = ProcList.GetProcessExecuteTime
   sizeArray = ProcList.GetProcessMemorySize



   var procid,index,pos,id;
  
   procid = Request.Form("isKill")
   if (procid != ""){
       procid = procid + ","
   }
   index = procid.indexOf(",")
  
   pos = 1
   id = idArray[procid.substr( pos, index)]
   Response.Write("the index is "+id+" <br> "+procid);
   while(index>=0){
       id = idArray[procid.substr( pos, index)]

       //Response.Write("ddddddddddd "+id);
       pos = index + 1
       index = procid.indexOf (",",pos)
   }
   idArray = ProcList.GetProcessIDs
   nameArray = ProcList.GetProcessNames
   timeArray = ProcList.GetProcessExecuteTime
   sizeArray = ProcList.GetProcessMemorySize
%>

<form method = "post" action = "proc.asp">
<p align = "center"><input name="B1" type="submit" value=" Refresh "></p>
   <table border = 1 align="center">
     <tr>
      <td><b>Kill Process?</b></td>
      <td><b>Process_Name</b></td>
      <td><b>PID</b></td>
      <td><b>CPU_Time</b></td>
      <td><b>Memory Usage</b></td>
     </tr>

      <%
      var l
      l = idArray.length - 1
     for (i = 0;i<  l;i++){
      %>

      <tr>
           <td><input type = "checkbox" name = "iskill" value = "
<%= i %>" ></td>
           <td><%= nameArray[i]%></td>
           <td><%= idArray[i]%></td>
           <td><%= timeArray[i]%></td>
           <td><%= sizeArray[i]%></td>
           </tr>
     <%
      }
     %>

   </table>
</form>
</blockquote>
</body>
</html>


Copyright © 1998-2002, Halcyon Software Inc. All rights reserved.