在线人数统计怎么就只增不减呢?
代码使用VB.net使用Global.asax代码如下:
sub session_start(byval sender as object,byval e as eventargs)
session.timeout=60
Application.Lock()
Application("CurrentUsers") = Application("CurrentUsers") + 1
Application.UnLock()
end sub
sub session_end(byval sender as object,byval e as eventargs)
Application.Lock()
Application("CurrentUsers") = Val(Application("CurrentUsers") - 1)
Application.UnLock()
end sub
为什么测试的时候,人员只会增加,当页面关闭时却不会减少呢?
先谢谢大家帮忙解答了