一组协同工作以执行某种目的的 ASP 文件称为应用程序。 Application 对象用于将这些文件连接在一起。
Web 上的应用程序可能由多个 ASP 文件组成,这些文件协同工作以执行某些目的。 Application 对象用于将这些文件连接在一起。
Application 对象用于存储和访问任何页面的变量,就像 Session 对象一样。区别在于所有用户共享一个应用程序对象(对于会话,每个用户都有一个会话对象)。
Application 对象保存将由应用程序中的许多页面使用的信息(例如数据库连接信息)。可以从任何页面访问该信息。信息也可以在一处进行更改,更改将自动反映在所有页面上。
Application 对象的集合、方法和事件描述如下:
Collection | Description |
---|---|
Contents | Contains all the items appended to the application through a script command |
StaticObjects | Contains all the objects appended to the application with the HTML <object> tag |
Method | Description |
---|---|
Contents.Remove | Deletes an item from the Contents collection |
Contents.RemoveAll() | Deletes all items from the Contents collection |
Lock | Prevents other users from modifying the variables in the Application object |
Unlock | Enables other users to modify the variables in the Application object (after it has been locked using the Lock method) |
Event | Description |
---|---|
Application_OnEnd | Occurs when all user sessions are over, and the application ends |
Application_OnStart | Occurs before the first new session is created (when the Application object is first referenced) |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!