Show | online | online | Everyone good I am Jackie Chan, very happy to see you again, the last time I remember someone in the forum asked the number of online solutions, now I put a piece of code posted for your reference
The application uses global.asp, a very important file, and two objects in the file: application and Session
Global.asa
<script language= "Vascript" runat= "Server"
Sub Application_OnStart
Session.timeout=3
' Lock application
Application.Lock
' Start setting count initialized to 0
Application ("Whoson") =0
' Untie application
Application.UnLock
Endsub
Sub Session_OnStart
Appication.lock
Application ("Whoson") = Application ("Whoson") +1
Application.UnLock
Endsub
Sub Session_OnEnd
Application.Lock
Application ("Whoson") = Application ("Whoson")-1
Application.UnLock
Endsub
</script>
The next is how to show the problem, hehe. In fact, the front of the problem solved, the back is a piece of cake, just need to show the OH place to add the following code: (Of course, if the ASP's document)
<%response.write "Current online number:" &application ("Whoson") & "People"%>
or the following code effect is the same:
Current online number: <%=application ("Whoson")%> person
Of course, if you want to decorate it beautifully, you can add a little bit of HTML modifier code.
Jackie chan
2001/7/20