Recommended: ASP batch generation of static pages Since my space is limited, I cannot generate all static pages in batches at once, so I wrote a small program to share with you. The program is quite simple, so don't laugh at experts! This code is a waste of time. The code is as follows
The number of visits to the Internet is a very concerning issue for every netizen who builds a website. How do you know how many people are visiting your website? How to record the number of visits every day? Here is a solution.
When a user starts to access the website, Global.asa on the server will be accessed. A session will be enabled for the user. You can set your own personal user information for each user. I won't explain much here. In Global.asa there are message response functions when Application starts and Session starts. You can type in the following code.
| The following is the quoted content: < SCRIPT LANGUAGE=VBScript RUNAT=Server > Sub Application_OnStart ' When the server is turned on, set the number of users to 0 Application(Users) = 0 End Sub Sub Session_OnStart Session.Timeout = 20 ' When starting a session, the number of users is increased by 1 Application.Lock Application(Users) = Application(Users) 1 Application.UnLock End Sub Sub Session_OnEnd ' When a Session is finished, the user counter is reduced by 1 Application.Lock Application(Users) = Application(Users) - 1 Application.UnLock End Sub < /SCRIPT > |
When the website is running, the Application variable Application (Users) will always record the number of people online on the website. The number of online users can be written out using any web page. As for recording, there are many methods that can be used. If it is recorded in a file, you can use the Scripting.FileSystemObject object for processing. If logged into the database, you can use ADO and so on. I won't introduce them one by one here.
Share: Must-have for learning ASp dynamic web pages: 38 commonly used functions 1. Function array() function: Create an array variable format: array(list) Parameter: list is each numeric column in the array variable, with comma spacing example: <% i = array (1,2,3&quo