Simply put, it can be understood that the application stores server-side data and can be changed by the task owner. To prevent multiple users from modifying the application at the same time, use the lock method to prevent others from modifying the application, wait until you finish the modification, and then use the unlock method to allow others to modify it.
Application. Lock/unlock usage:
Application. Lock ();
// OthersCode
Application [ " Value " ] = 1 ;
// Other code
Application. Unlock ();
When application. Lock is executed on any web page of the website, all operations related to the application on the whole site will be locked and delayed. (Including application assignment and application reading );
Eg.
Page:
Application. Lock ();
Application [ " Value " ] = 1 ;
System. Threading. thread. Sleep ( 10000 );
Application. Unlock ();
Page B:
Object Value = applcation [ " Value " ];
We first execute page A, and then execute page B. Because the application is locked on page A, you must wait until the execution on page a is complete before obtaining the value in application on page B.
The session stores client data and can only be changed (private) by itself ).