ASP Application Objects Tutorial

Source: Internet
Author: User

The ASP Application object is used to share information between all users of a specific aspapplication program. All ASP files are part of a virtual directory in IIS, the same aspapplication program.

The Application.Contents collection contains all the items, and also adds commands for Aspapplication objects and ASP scripts.

The Application.staticobjects collection contains all the objects and adds <OBJECT> tags to the ASP application program objects.

You can store variables into the Application.Contents collection method as follows:

Application (otalapplicationusers) = 255

You can read and display a variable stored in the Application object and have the following ASP code:

Response.Write Application (Otalapplicationusers)

Always remember that application objects share the Aspapplication program between all users.

2 ASP Application main object methods Application.Lock and Application.UnLock. The Aspapplication program objects are common to all users of the Aspapplication program, This application.lock and Application.UnLock method guarantees that no more than one user can change a variable stored in a Application object at any given moment.

Here's how to use the Application.Lock and Application.UnLock methods to change a variable stored in a Application object:

Application.Lock
Application (otalapplicationusers) =application (otalapplicationusers) + 1
Application.UnLock

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.