<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Application_OnStart
’ 當服務器開啟時,設置用戶數為0
Application("Users") = 0
End Sub
Sub Session_OnStart
Session.Timeout = 20 ’ 當開始一個Session時用戶數加1
Application.Lock
Application("Users") = Application("Users") + 1
Application.UnLock
End Sub
Sub Session_OnEnd
’ 當結束一個Session時用戶計數器減1
Application.Lock
Application("Users") = Application("Users") - 1
Application.UnLock
End Sub
</SCRIPT>