Is the number of statistics online real time? _ Programming 10000 Q

Source: Internet
Author: User

Global.asa

<script language= "VBScript" runat= "Server" >

Sub Application_OnStart

Application ("activeusers") = 0

' Starting from 0 . But you can set it more Oh , so even if no one online , people come to your site will see 900 more people on the line .

End Sub

Sub Session_OnStart

Session.Timeout = 20

' set the session timeout to minutes--This is the key to the gimmick and how much you want to set .

Session ("Start") = Now

' Session start time

Application.Lock

Application ("activeusers") = Application

("Activeusers") + 1

Application.UnLock

' asked statistics true number of visitors .

End Sub

Sub Session_OnEnd

Application.Lock

Application ("activeusers") = Application

("Activeusers")-1

Application.UnLock

End Sub

</script>

[1]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.