Introduction to using application objects in ES0en. NET

  • 2020-12-10 00:40:34
  • OfStack

Application of the Application object

1. Use Application objects to save information

(1) Use Application object to save information

Application(" key name ") = value

Or Application(" key name ", value)

(2) Obtain 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 Application object

Application. Set(" key name ", value)

(4) Delete 1 key

Application. Remove(" key name ", value)

(5) Delete all keys

Application.RemoveAll()

Or Application. Clear ()

To summarize the characteristics of Application:

· Physical location of storage: server memory.

· Type limitation of storage: any type.

· Scope of state usage: the entire application.

· Storage size limit: any size.

· Life cycle: the application is created at the beginning (specifically the first time the user requests URL) and destroyed at the end of the application.

· Security and performance: The data is always stored on the server side, with high security, but it is difficult to store too much data.

· Advantages, disadvantages and precautions: Fast retrieval of data, but lack of self-management mechanism, data will not be released automatically.

Related articles: