1. Set of Application objects
In the Application, there are two sets of Contents and StaticObject. You can use these two sets to control whether variables and objects are visible in the entire ASP Application.
The Contents set is a set of variables, which are visible to each Session in an ASP Application. These variables are used at the Application level and can be used. contents ("CurrentDiscount") = 1. Since this set is the default set of Application objects, the previous line of code can also be written as follows: application ("CurrentDiscount") = 1.
The StaticObject set uses global. created by the asa file, global. the asa file is part of an ASP Application. It provides you with a way to compile the code to run when the ASP Application starts or stops, it also provides the function of compiling code to run at the beginning and end of the Session.
I. Attributes
Although the Application object does not have built-in attributes, we can use the following syntax to set user-defined attributes, also known as collections.
Application ("attribute/set name") = value
We can use the following script to declare and create the attributes of the Application object.
<%
Application ("MyVar") = "Hello"
Set Application ("MyObj") = Server. CreateObject ("MyComponent ")
%>
Once an Application object is assigned a property, it will persist until the WEB server service is disabled to stop the Application. The value stored in the Application object can be read by all users of the Application program. Therefore, the attribute of the Application object is especially suitable for transmitting information between users of the Application program.
II. Method
The Application object has two methods, both of which are used to process data written by multiple users in the Application.
1. The Lock method prohibits other customers from modifying the properties of the Application object.
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