Implementation of free Counter with ASP-3

Source: Internet
Author: User
Tags count servervariables
Counter 5.easpcount.asp.
<%response.expires=0
Id=request.querystring ("id")
Sername=request.servervariables ("SERVER_NAME")
Scrname=request.servervariables ("Script_name")
Linkurl= "http://" & Sername & Left (Scrname, (Len (scrname) -9)) & "Easpcount.asp?id=" &id
infile = Server.MapPath ("counter.asp")
Set fs = CreateObject ("Scripting.FileSystemObject")
Set thisfile = fs. OpenTextFile (Infile,1,false)
Counter = 0
Do as not thisfile. AtEndOfStream
Thisline = Thisfile.readline
Redim Preserve input (counter)
Input (counter) = Thisline
Counter = counter + 1
Loop
Thisfile. Close
Number= (counter-1)/5
X=0
Set outfile = fs. CreateTextFile (infile)
Application.Lock
OutFile. WriteLine input (0)
For I=1 to number
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)
If input ((i-1) *5+1) =id Then
X=i
OutFile. WriteLine input ((i-1) *5+5) +1
Else
OutFile. WriteLine input ((i-1) *5+5)
End If
Next
OutFile. Close
Application.UnLock
Set fs=nothing
If X=0 then Response.End
COUNT=CSTR (Input ((x-1) *5+5))
Countlen=len (count)
For I=1 to 6-countlen
Linkurl= "http://" &sername&left (Scrname, (Len (scrname) -13)) "/" & "0.gif"
%><%=linkurl%>
document.write (' ")
<%=linkurl%>
<%next
For I=1 to Countlen
Mdir=mid (count,i,1)
Linkurl= "http://" &sername&left (Scrname, (Len (scrname) -13)) "/" &mdir& ". gif"
%>
<%=linkurl%>
document.write (' ")
<% Next
%>
---------------------------------------------------
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.