相关资讯
本类常用软件
-
福建农村信用社手机银行客户端下载下载量:584204
-
Windows优化大师下载量:416896
-
90美女秀(视频聊天软件)下载量:366961
-
广西农村信用社手机银行客户端下载下载量:365699
-
快播手机版下载量:325855
下面提供给大家分享的是关于Asp遍历Request,Session和Application服务器对象的代码,希望对大家有用。
一 遍历Request
方式1:
<%
For Each r In Request.QueryString
Response.Write "Request("""&r&""") = " & Request(r)
Response.Write "<p>"
Next
%>
方式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
%>
<%
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
%>
<%
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
%>
<%
Application("key1")="value1"
Application("key2")="value2"
For Each a In Application.Contents
Response.Write "Application("""&a&""") = " & Application(a)
Response.Write "<p>"
Next
%>
热门评论
最新评论