Implementation of free Counter with ASP-2

Source: Internet
Author: User
Tags count readline
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>
&LT;TD width= "><font" color= "#FF00FF" > Number </font></td>
&LT;TD width= "><font" color= "#FF00FF" > Username </font></td>
&LT;TD width= "360" ><font color= "#FF00FF" > site name </font></td>
&LT;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



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.