asp.net.ph

Application.Lock Method

System.Web Namespace   HttpApplicationState Class


Locks access to an HttpApplicationState variable to facilitate access synchronization.

[ VB ]
Public Sub Lock ( ) 

[ C# ]
public void Lock ( );

[ C++ ]
public: void Lock ( );

[ JScript ]
public function Lock ( );

Example

The following example uses Lock ( ) and UnLock ( ) to prevent other sessions from changing the value of an application variable until after the local session has changed them.

Application.Lock ( );
Application [ "myPageHits" ] = Convert.ToInt32 ( Application [ "myPageHits" ] ) + 1;
Application.UnLock ( );
  C# VB JScript

See Also

HttpApplicationState Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph