|
|
|
|
|
| | |
| |
Active Server Pages asp source code database MS SQL MS Access .mdb adovbs.inc cookies calendar codes sql commands scripts asp programming tutorials iis web server components CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
|
|
Subject: |
Re: How do I get a N0 of users on line like the one in the top corner? |
|
From: |
Daniel_M |
|
Date: |
9/6/2000 1:31:42 PM |
|
IP: |
63.194.23.213 |
Here is the code that I use.
Put this where you want the number of users displayed:
<%= Application("ActiveUsers") %>
Put this code in your GLOBAL.ASA file:
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Application_OnStart
Set our user count to 0 when we start the server
Application("ActiveUsers") = 0
End Sub
Sub Session_OnStart
Change Session Timeout to 20 minutes (if you need to)
Session.Timeout = 20
Set a Session Start Time
This is only important to assure we start a session
Session("Start") = Now
Increase the active visitors count when we start the session
Application.Lock
Application("ActiveUsers") = Application("ActiveUsers") + 1
Application.UnLock
End Sub
Sub Session_OnEnd
Decrease the active visitors count when the session ends.
Application.Lock
Application("ActiveUsers") = Application("ActiveUsers") - 1
Application.UnLock
End Sub
</SCRIPT>
|
Previous Message
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|