Logo Head Picture  free e- mail 
 thaimail 
 hotmail 
 yahoo 
 siam2you 
 thammasat
 Home  Visual Basic Active Server Page  JavaScript   Network   Other 
 Active Server Pages.











EVENT:  Application_OnEnd

The Application_OnEnd event occurs when the Application ends. This should only happen when the web server is stopped by the operating system in a normal manner. The Application_OnEnd event is simply a subroutine with a reserved name that is placed within the Global.asa file. It can contain any script that you wish to run after all user sessions are finished. For example, you may wish to compute and store statistics on user sessions for future reference.
 
Note: The only built-in ASP objects available from within the OnEnd event handler are Server and Application.

Code:
-------------------Global.asa--------------------------
<script Language="VBScript" RUNAT=Server>
Sub Application_OnEnd()
     Calculate_Stats()
End Sub

Sub Application_OnStart()
     Application("NumSession") = 0
     Application("NumVisited") = 0
End Sub

Sub Session_OnEnd()
     Application("NumSession") = Application("NumSession") - 1
End Sub

Sub Session_OnStart()
     Application("NumSession") = Application("NumSession") + 1
     Application("NumVisited") = Application("NumVisited") + 1
End Sub 
</script>

-------------------File1.asp----------------------------
Response.Write "You are " & Application("NumSession") & " of " & Application("NumVisited") & " users."

Copyright 2000 by Infinite Software Solutions, Inc.
Trademark Information

ASP - Link
ASP reference   
B   
C   
D   
E   
F   
G   
Last update: Copyright © 2001.Memo Wil@keo everything that I like Co.,Ltd.