阿七
级别: 未验证会员
精华:
0
发帖: 909
威望: 0 点
金钱: 2161 RMB
贡献值: 0 点
在线时间:512(小时)
注册时间:2006-03-29
最后登录:2008-08-07
|
Asp遍历服务器对象的代码
一 遍历Request 2o}8W7y 方式1: *<3iEeO/R <% tQnJS2V"{u For Each r In Request.QueryString `R ]&F$i(E Response.Write "Request("""&r&""") = " & Request(r) h=mv9=x Response.Write "<p>" s @3zx Next ~pwY6Q %> dK7 ^ 方式2: :if5z2PE/ <% n]Ebwznt- For i = 1 To Request.QueryString.Count '4Y*-!9 Response.Write "Request("""&Request.QueryString.Key(i)&""") = " & Request.QueryString(Request.QueryString.Key(i)) x
KisL=l6Y Response.Write "<p>"
.;}pU!S~R Next _c,&\ wl$ %> OQ
0b$qw 将QueryString改为Form,即可遍历Post变量。 Xek E#?. 二 遍历Session |c
BHBd <% HKT{IP+7(L Session("key1")="value1" ~n)]dFy Session("key2")="value2" j=p|'` For Each s In Session.Contents mRNHq3 Response.Write "Session("""&s&""") = " & Session(s) )E_!rR Response.Write "<p>" *YMXiYJR Next !$4Q]@ } %> R#rh 二 遍历Application sT@u3^> <% GXGN;,7EV Application("key1")="value1" ;g!xQvcR Application("key2")="value2" IhtmD@H} For Each a In Application.Contents 6uv'r;U] Response.Write "Application("""&a&""") = " & Application(a) Vu^Q4Z Response.Write "<p>" XL%vO#YT Next 'lSnyW{ %>
|
|
[楼 主]
|
Posted: 2006-04-04 14:28 |
| |