asp利文本文档加FSO统计网站访问量的方法(2)
网络 2009/9/15 8:21:17 深山行者 字体:
大 中 小 浏览 10257
1.新建count.txt文件文档
<%
response.write "您是本页的第"&counter()&"位访客"
function counter()
whichfile=server.mappath("count.txt")
'打开文件并将其值读取,最后关闭连接释放资源
set fso=createobject("Scripting.FileSystemObject")
set openfile=fso.opentextfile(whichfile,1)
visitors=openfile.readline
openfile.close
'页面显示记数内容并做加1运算
visitors=visitors+1
'将新的数值添加写入到文本,最后关闭所有连接释放资源
set creatfile=fso.createtextfile(whichfile)
creatfile.writeLine(visitors)
creatfile.close
set fso=nothing
counter=visitors
end function
%>
- 相关阅读
- asp数组随机排序
- 微信公众号回复图文消息或用客服接口推送图文消息
- 连云港门窗制作
- 详解HTML标记里面的em和strong的区别
- 放心会计
- 微信小程序打开客服提示:该小程序提供的服务出现故障,请稍后重试
- 深山旅行社管理系统免费版 V2.3
- asp读取QQ的rss之xml数据
- 共有0条关于《asp利文本文档加FSO统计网站访问量的方法(2)》的评论
- 发表评论