2. Creating a Variant array
The method of creating and using a Variant array to store values in the session and application objects is not currently discussed, and is discussed here as a very useful technique. As already seen, a Variant data type can contain an array, not just a value.
An array stores only a long line of binary values in a contiguous area of memory in a specified order. To schedule a variant, you need to point to the first item and give information about the size and structure, and the scripting engine can do the rest.
You can create a one-dimensional, two-dimensional, or multidimensional array in a Variant variable, and then assign the array to a variable in an application layer or user session layer, and make sure that the entire array is available in the appropriate place. The following code demonstrates a simple use technique for one-dimensional arrays:
Dim Vararray (3)
Vararray (0) = "This is a"
Vararray (1) = "Variant array"
Vararray (2) = "stored in"
Vararray (3) = "Session Object"
Session ("Variant_array") = Vararray
3. When the application and session starts and ends
This is mentioned in the introduction of ASP applications and how the session works. Outlined below in the most basic terms:
· Starts the application when the first user requests an ASP page of a user-defined virtual application within the scope of the application (that is, the default root of the Web site), or within a subdirectory of the Web site. Occurs before any user session is started.
· When any user requests an ASP page in the default application or a virtual application for the first time, start a session (if there is no active session).
· The session ends when the user does not download an ASP page within the timeout period specified by the session. The timeout can be set by using the Session.Timeout property in script code, either individually in the Properties dialog box, or through the IIS: Partial modification of the default values in the IIS metabase in Active Directory. When a Web page that calls the Session.Abandon method completes execution, the session also ends.
· After the end of the last active session in an application, the application ends immediately.
4. ASP processing Instructions
As seen in chapter 1th, you can add a single processing instruction to an ASP page. A processing instruction can contain more than one entry as needed. The keywords and their descriptions that you can use in statements are as shown in table 3-10:
Table 3-10 ASP directive keyword and description
Directive key word
Description
Language= "Language_name"
Sets the default scripting language for this page, such as: <% @ language= "VBScript"%>
Enablesessionstate= "True" | " Fasle "
Prevents a cookie from a session from being sent to the browser when set to True, so no new session object will be created and the contents of any existing sessions will no longer be available
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