Sub Application_OnEnd
' 将保存在 Application 对象中 FileSystemObject 对象
' 及counter.txt 的实际路径读出来
Set fs = Application("fs")
counter_file = Application("counter_file")
Set txt = fs.CreateTextFile( counter_file, True )
txt.WriteLine(cstr(Application("counter")))
txt.Close
End Sub
</script>
3。
需要调用的页面加入下面代码:
<%
if not session("enterisok") then
session("enterisok")=true
application.lock
if Application("counter")<=0 then
Application("counter")=1
else
Application("counter")=Application("counter")+1
end if
session("count")=Application("counter")
application.unlock
end if
'在页面上写计数
response.write session("count")
%>