今天做了一個ASP計數器,放出源碼吧,挺簡單的!

來源:互聯網
上載者:User
計數器 '前天在johnny的專欄看到一個計數器,忽然想起以前我也做過~~今天就翻出來改了一下嵌入到我的BLOG中了~~放在別人的伺服器上~~放出源碼大家有用得著的看看吧~~如果不喜歡用圖片的就改成文字得了!圖片檔案大家可以自己找點好看的放上!

'************************調用*********************
'* <script language="javascript" src="xxx.asp?max=8"></script>
'*************************************************

javastr="<div algin='center'>"
<%
max=Request("max") '//計數器位元
If Request.cookies("count")="" Then '//防刷
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set fp=fso.OpenTextFile(Server.MapPath("count.dat")) '//計數器統計檔案
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+"<img src=http://www.163design.net/a/y/count/0.gif' border=0>" '//計數器圖片檔案
<%
Next
j=0
For i=(max-len(s)) to max-1
j=j+1
%>
javastr=javastr+"<img src='http://www.163design.net/a/y/count/<%=mid(s,j,1)%>.gif' border=0>"
<%
Next
Set fp=Nothing
Set fso=Nothing
javastr=javastr+"</div>"
%>
document.write(javastr)



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.