ASP traverses some objects (request, session, Application)
Source: Internet
Author: User
1. Traverse request
Method 1:
<%
For each R in request. querystring
Response. Write "Request (" "& R &" ") =" & request (r)
Response. Write "<p>"
Next
%>
Method 2:
<%
For I = 1 to request. querystring. Count
Response. Write "Request (" "& request. querystring. Key (I) &" ") =" & request. querystring (request. querystring. Key (I ))
Response. Write "<p>"
Next
%>
Change querystring to form to traverse the post variable.
2. Traverse sessions
<%
Session ("key1") = "value1"
Session ("key2") = "value2"
For each s in session. Contents
Response. Write "Session (" "& S &" ") =" & session (s)
Response. Write "<p>"
Next
%>
3. Traverse Application
<%
Application ("key1") = "value1"
Application ("key2") = "value2"
For each a in application. Contents
Response. Write "application (" "& A &" ") =" & Application ()
Response. Write "<p>"
Next
%>
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