前天在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=count/0.gif border=0>" //计数器图片文件
<%
next
j=0
for i=(max-len(s)) to max-1
j=j+1
%>
javastr=javastr+"<img src=count/<%=mid(s,j,1)%>.gif border=0>"
<%
next
set fp=nothing
set fso=nothing
javastr=javastr+"</div>"
%>
document.write(javastr)
