global.asa:
<script LANGUAGE=VBSCRIPT runat = server>
sub application_onstart
application.lock
application("online"
= 0
application("countall "
= 0
application.unlock
end sub
sub session_onstart
application.lock
application("online"
= application("online"
+ 1
application("countall"
= application("countall"
+ 1
application.unlock
end sub
sub session_onend
application.lock
application("online"
= application("online"
- 1
application.unlock
end sub
sub application_onend
application.lock
application.unlock
end sub
</script>
peopleonline.asp:
<" %>
<html>
<body>
<% session.Timeout= 5 %>
<p>在线人数:<%=application("online"
%></p>
<p>访问总人数:<%=application("countall"
%></p>
</body>
</html>
这是在网上看到的一段代码,其中
sub application_onend
application.lock
application.unlock
end sub
是什么意思?起什么作用呢?谢谢了!
当应用程序停止的时候锁住application然后又打开,没有意义呀!想不通!