复制代码 代码如下:
一 遍历Request
方式1:
<%
For Each r In Request.QueryString
Response.Write "Request("""&r&""") = " & Request(r)
Response.Write "<p>"
Next
%>
方式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
%>
将QueryString改为Form,即可遍历Post变量。
二 遍历Session
<%
Session("key1")="value1"
Session("key2")="value2"
For Each s In Session.Contents
Response.Write "Session("""&s&""") = " & Session(s)
Response.Write "<p>"
Next
%>
三 遍历Application
<%
Application("key1")="value1"
Application("key2")="value2"
For Each a In Application.Contents
Response.Write "Application("""&a&""") = " & Application(a)
Response.Write "<p>"
Next
%>
一 遍历Request
方式1:
<%
For Each r In Request.QueryString
Response.Write "Request("""&r&""") = " & Request(r)
Response.Write "<p>"
Next
%>
方式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
%>
将QueryString改为Form,即可遍历Post变量。
二 遍历Session
<%
Session("key1")="value1"
Session("key2")="value2"
For Each s In Session.Contents
Response.Write "Session("""&s&""") = " & Session(s)
Response.Write "<p>"
Next
%>
三 遍历Application
<%
Application("key1")="value1"
Application("key2")="value2"
For Each a In Application.Contents
Response.Write "Application("""&a&""") = " & Application(a)
Response.Write "<p>"
Next
%>
标签:
Asp遍历服务器对象的代码
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“Asp遍历服务器对象的代码”评论...