新客网WWW.XKER.COM:致力做中国最专业的网络学院!
学院: 操作系统 - 网络应用 - 服务器 - 网络安全 - 工具软件 - 办公软件 - Web开发 - 数据库 - 网页设计 - 图形图像 - 媒体动画 - 硬件学堂 - 存储频道 - QQ专区
您的位置:首页 > 软件开发 > Web开发 > Asp教程 > 正文:用ASP实现免费计数器提供-3

用ASP实现免费计数器提供-3

新客网 XKER.COM 2003-04-15 来源: 收藏本文
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 while 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('<img src="<%=linkurl%>">')
<%=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('<img src="<%=linkurl%>">')
<% next
%>
---------------------------------------------------
writen by aspboy and powered by http://easp.126.com
收藏】 【评论】 【推荐】 【投稿】 【打印】 【关闭
发表评论
要记得去论坛讨论,点击注册新会员匿名评论
评论内容:不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
阅读排行
随机推荐
实用信息推荐