Today I made an ASP counter. Let's release the source code. It's quite simple!

Source: Internet
Author: User
Tags readline
'The day before yesterday, I saw a counter in johnny's column and suddenly remembered that I had done it before ~~ Today, I flipped it out and changed it into my BLOG ~~ Put it on someone else's server ~~ Let's take a look at the available source code ~~ If you do not like the image, you can change it to text! You can find some nice image files on your own!
************** *******
'* <Script language = "javascript" src = "xxx. asp? Max = 8 "> </script>
'*************************************** **********
Javastr = "<div algin = 'center'>"
<%
Max = Request ("max") '// number of counters
If Request. cookies ("count") = "" then' // Anti-click farming
Set fso = Server. CreateObject ("Scripting. FileSystemObject ")
Set fp = fso. OpenTextFile (Server. MapPath ("count. dat") '// counter statistics file
Countn = fp. Readline
Countn = countn + 1
Fp. close
Set fp = Nothing
Set fp = fso. createtextfile (server. mappath ("count. dat "))
Fp. Writeline countn
Set fp = nothing
Set fso = nothing
Response. Cookies ("count") = countn
End If
Set fso = Server. CreateObject ("Scripting. FileSystemObject ")
Set fp = fso. OpenTextFile (Server. MapPath ("count. dat "))
S = fp. Readline
For n = (max-len (s) to 1 step-1
%>
Javastr = javastr + "" '// counter image file
<%
Next
J = 0
For I = (max-len (s) to MAX-1
J = j + 1
%>
Javastr = javastr + ". gif 'border = 0>"
<%
Next
Set fp = Nothing
Set fso = Nothing
Javastr = javastr + "</div>"
%>
Document. write (javastr)

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.