After a few days of groping, test, today can finally be application and session object of start and end method to do a summary.
Application_Start: The first user to access the site will trigger the method. Some system variables are usually defined in this method, such as the total number of online chat rooms, the initialization of historical visitor demographics, and so on.
Application_End: This method is triggered when a Web site is closed or restarted. No excessive experimentation was carried out.
Session_Start: triggered when each user accesses the first page of a website;
Session_End: Session.Abandon () is used, or the session timeout is triggered after the user exits. Note that the Session object, server object, Server.MapPath () cannot be used in Session_End. So you can only replace the session ("username") with session.contents ("username"). or using application objects or methods;
For example, to use Server.MapPath ("Users.xml") in Session_End, you should define application ("Xmlpath") in Application_Start = Server.MapPath (" Users.xml "), and then call application (" Xmlpath ") in the Session_End, not directly in session_end such as: Server.MapPath (" Users.xml "),
Their order of execution is: 1:application_start 2:session_start; 3:session_end:4 Application_End
Summary of the start end method for ASP. Application and Session