一聚教程网:一个值得你收藏的教程网站

热门教程

asp+txt创建简单的计数器

时间:2022-07-02 22:43:45 编辑:袖梨 来源:一聚教程网


文件如下:
<%
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
%>

热门栏目