龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > asp编程 >

asp+txt创建简单的计数器

时间:2012-12-31 22:56来源:未知 作者:admin 点击:
分享到:
asp+txt创建简单的计数器 文件如下: % dim vis set js=createobject(scripting.filesystemobject) set f=js.createtextfile(D:/count.txt,true) f.writeline 0 f.close whichfile=js.getfile(D:/count.txt) set thisfile=js.opentextfile(whichfi

asp+txt创建简单的计数器

文件如下:
<%
dim vis
set js=createobject("scripting.filesystemobject")
set f=js.createtextfile("D:/count.txt",true)
f.writeline 0
f.close
whichfile=js.getfile("D:/count.txt")
set thisfile=js.opentextfile(whichfile)
vis=thisfile.readline
thisfile.close
vis=vis+1
response.write vis
set out=js.createtextfile(whichfile)
out.writeline vis
out.close
%>
//测试只显示1,而不刷新为2,依以类推.
如果把上面建立的文件d:/count.txt,这部分去掉,文件如下:
<%
dim vis
set js=createobject("scripting.filesystemobject")
whichfile=js.getfile("D:/count.txt")
set thisfile=js.opentextfile(whichfile)
vis=thisfile.readline
thisfile.close
vis=vis+1
response.write vis
set out=js.createtextfile(whichfile)
out.writeline vis
out.close
%>


精彩图集

赞助商链接