我在做一个简单的网站访问量运行时,比如counter.txt里是 100,但再访问没变化,请朋友们指教
<%
dim fs,ts,c,i
set fs=createObject("Scripting.filesystemObject")
set ts=fs.opentextfile(server.mappath("counter.txt"))
c=ts.readline
for i=1 to len(c)
response.write mid(c,i,1)
next
session("number_summe")=session("number_summe")+1
ts.close
set fs=nothing
%>
<%application.lock
ia
application.unlock
sub ia()
set fs=server.createobject("scripting.filesysytemobject")
counter_file=server.mappath("/counter.txt")
set txt=fs.opentextfile(counter_file)
application("counter")=txt.readline
txt.close
application("counter")=application("counter")+1
set txt=fs.createtextfile(counter_file,true)
txt.writeline(application("counter"))
txt.close
end sub
%>