Counter 4. User Management Program
<%response.expires=0
Dim input ()
Thisfile = Server.MapPath ("counter.asp")
Set fs = CreateObject ("Scripting.FileSystemObject")
Set thisfile = fs. OpenTextFile (Thisfile,1,false)
Count = 0
Do as not thisfile. AtEndOfStream
Thisline = Thisfile.readline
Redim Preserve input (count)
Input (count) = Thisline
Count = Count + 1
Loop
Thisfile. Close
Number= (count-1)/5
Set fs=nothing
%>
<title> Counter Management System </title>
<body>
<p align= "center" ><font style= "font-size:20pt" > Counter Management System </font></p>
<p align= "Center" > currently reserved user <%=number%> </p>
<table width= "760" >
<tr>
<TD width= "><font" color= "#FF00FF" > Number </font></td>
<TD width= "><font" color= "#FF00FF" > Username </font></td>
<TD width= "360" ><font color= "#FF00FF" > site name </font></td>
<TD width= "><font" color= "#FF00FF" > Delete </font></td>
</tr>
<%x= ""
For I=1 to number
X=input ((i-1) *5+1)
Response.Write "<tr><td width= ' ><font color= #00ffFF >" &i & "</font>"
Response.Write "<td width=200 ><font color= #FFffFF >" &input ((i-1) *5+1) & "</font></td > "Response.Write" <td
width=360 ><font color= #FF00FF > "&input ((i-1) *5+4) &" </font></td> "
Response.Write "<td width=100 align=left><a href=dele.asp?id=" &x& "> Delete </a></td>< /tr> "
Next
%>
</table>
</body>
5. User Removal Handler dele.asp
<%response.expires=0
Dim input ()
Id=request.querystring ("id")
Thisfile = Server.MapPath ("counter.asp")
Set fs = CreateObject ("Scripting.FileSystemObject")
Set infile = fs. OpenTextFile (Thisfile,1,false)
Counter = 0
Do as not infile. AtEndOfStream
Thisline = Infile.readline
Redim Preserve input (counter)
Input (counter) = Thisline
Counter = counter + 1
Loop
InFile. Close
Number= (counter-1)/5
Set outfile = fs. CreateTextFile (Thisfile)
OutFile. WriteLine input (0)
For I=1 to number
If input ((i-1) *5+1) <>id Then
OutFile. WriteLine input ((i-1) *5+1)
OutFile. WriteLine input ((i-1) *5+2)
OutFile. WriteLine input ((i-1) *5+3)
OutFile. WriteLine input ((i-1) *5+4)
OutFile. WriteLine input ((i-1) *5+5)
End If
Next
OutFile. Close
Set fs=nothing
Response.Redirect "Manage.asp"
%>
---------------------------------------------------
Writen by Aspboy and powered by http://easp.126.com