This article mainly introduces the use of application objects in ASP.net, the need for friends can refer to the following
The application of Application object
1. Save information using the Application object
(1), use Application object to save information
Application ("key name") = value
or application ("Key Name", value)
(2), get Application object information
Variable name = Application ("Key Name")
OR: Variable name = Application.item ("Key Name")
OR: Variable name = Application.get ("Key Name")
(3), update the value of the Application object
Application.set ("Key Name", value)
(4), delete a key
Application.remove ("Key Name", value)
(5), delete all keys
Application.removeall ()
or Application.clear ()
Summarize the characteristics of application:
· Physical location of storage: server memory.
· Type limit for storage: any type.
· The scope of the state used: the entire application.
· Storage size limit: any size.
· Lifecycle: The application is created at the start (exactly when the user requests a URL for the first time) and is destroyed at the end of the application.
· Security and performance: Data is always stored on the server side, security is high, but it is not easy to store too much data.
· Advantages and Disadvantages: fast retrieval of data, but lack of self-management mechanism, data will not be automatically released.