How many users are there?

Discussion in 'C#' started by shajimanjeri, Nov 25, 2006.

  1. #1
    Hi all,

    I am new to ASP Vbscript.
    Here how to find in ASP Vbscript, how many users are using my website right now.

    Pls help me

    Shaji
     
    shajimanjeri, Nov 25, 2006 IP
  2. shaileshk

    shaileshk Well-Known Member

    Messages:
    455
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    shaileshk, Nov 27, 2006 IP
  3. poliedro

    poliedro Active Member

    Messages:
    152
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Put in global asa....

    <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>
    PHP:
     
    poliedro, Dec 2, 2006 IP