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