[分享]晓坪图片计数器——非常方便
计数器图片下载:
<%
'晓坪ASP计数器分享,如有疑问,请联系:328233820
'1、在网站根目下面建立一个文件名为num.txt的文本文件,并输入初始数字,例如:100
'2、将下载的数字图片放入网站根目录下的jsq目录下(目录可以自己改写)
也可自己制作(取名为:0.gif、1.gif、2.gif …… 9.gif 就行了)
'3、这里显示图片计数的位数默认6位,超出6位后自动以文本记数,可自行添加代码?增加计数量
'4、做好1、2步后,将下面代码粘贴到计数器所要显示的位置,之后你就测试一下网站吧!!
' 复制的时候,先将代码复制作到文本文件中,再从文本文件中复制到网页制作软件中。
%>
<% Sub Numberpad() Set files=Server.CreateObject("Scripting.FileSystemObject") Set numtxt=files.OpenTextFile(Server.MapPath("/Num.txt")) Application("Num")=numtxt.ReadLine numtxt.Close Application("Num")=Application("Num")+1 %> <%if len(application("num"))=1 then%><img border="0" src="jsq/<%=Application("Num")%>.gif"><%end if%><%if len(application("num"))=2 then%><img border="0" src="jsq/<%=left(Application("Num"),1)%>.gif"><img border="0" src="jsq/<%=right(Application("Num"),1)%>.gif"><%end if%><%if len(application("num"))=3 then%><img border="0" src="jsq/<%=left(Application("Num"),1)%>.gif"><img border="0" src="jsq/<%=mid(Application("Num"),2,1)%>.gif"><img border="0" src="jsq/<%=right(Application("Num"),1)%>.gif"><%end if%> <%if len(application("num"))=4 then%><img border="0" src="jsq/<%=left(Application("Num"),1)%>.gif"><img border="0" src="jsq/<%=mid(Application("Num"),2,1)%>.gif"><img border="0" src="jsq/<%=mid(Application("Num"),3,1)%>.gif"><img border="0" src="jsq/<%=right(Application("Num"),1)%>.gif"><%end if%> <%if len(application("num"))=5 then%><img border="0" src="jsq/<%=left(Application("Num"),1)%>.gif"><img border="0" src="jsq/<%=mid(Application("Num"),2,1)%>.gif"><img border="0" src="jsq/<%=mid(Application("Num"),3,1)%>.gif"><img border="0" src="jsq/<%=mid(Application("Num"),4,1)%>.gif"><img border="0" src="jsq/<%=right(Application("Num"),1)%>.gif"><%end if%> <%if len(application("num"))=6 then%><img border="0" src="jsq/<%=left(Application("Num"),1)%>.gif"><img border="0" src="jsq/<%=mid(Application("Num"),2,1)%>.gif"><img border="0" src="jsq/<%=mid(Application("Num"),3,1)%>.gif"><img border="0" src="jsq/<%=mid(Application("Num"),4,1)%>.gif"><img border="0" src="jsq/<%=mid(Application("Num"),5,1)%>.gif"><img border="0" src="jsq/<%=right(Application("Num"),1)%>.gif"><%end if%> <%if len(application("num"))>6 then response.write "<font color=red><b>"&Application("num")&"</b></font>"%> <% Set numtxt=files.CreateTextFile(Server.MapPath("/Num.txt"),True) numtxt.WriteLine(Application("Num")) numtxt.Close End Sub Application.Lock Numberpad Application.UnLock %> |
[此贴子已经被作者于2006-3-14 12:46:18编辑过]