常州五颜六色网络技术有限公司 -> 网站建设 -> Asp遍历服务器对象的代码 登录 -> 注册 -> 回复主题 -> 发表主题

阿七 2006-04-04 14:28
一 遍历Request 748:* (O  
方式1: 'g'RXC}D>  
<% Z~8%bfpe  
For Each r In Request.QueryString : D-D+x  
Response.Write "Request("""&r&""") = " & Request(r) ~9yK MUf  
Response.Write "<p>" r =vY-p  
Next Jvsy 6R  
%> _5~|z$GW  
方式2: wCR! bZ w  
<% {B k` Zlki  
For i = 1 To Request.QueryString.Count Ka-o$o[^u`  
Response.Write "Request("""&Request.QueryString.Key(i)&""") = " & Request.QueryString(Request.QueryString.Key(i)) ]y=U"g  
Response.Write "<p>" &|ne!wu  
Next g'7 \WQ  
%> &y=OZ !M  
将QueryString改为Form,即可遍历Post变量。 gT$WG$^i  
二 遍历Session qK#"uU8B  
<% %aK[Yvo6  
Session("key1")="value1" LmqSxHs0Q  
Session("key2")="value2" \ m oLQ  
For Each s In Session.Contents hLgX0QV  
Response.Write "Session("""&s&""") = " & Session(s) Oy=0Hsh@x  
Response.Write "<p>" g_P98_2f.k  
Next N~ CQh=<  
%> )z@ +|A  
二 遍历Application JvW7h(u7g  
<% @#t<!-8d  
Application("key1")="value1" $poIWJMc  
Application("key2")="value2" \9#f:8Q  
For Each a In Application.Contents Tr:@Dv.O  
Response.Write "Application("""&a&""") = " & Application(a) m]MR\E5]By  
Response.Write "<p>" Ezew@*(  
Next [u K,.G  
%>


查看完整版本: [-- Asp遍历服务器对象的代码 --] [-- top --]



Copyright © 2005-2014 5y6s Inc. 苏ICP备05001866号 Powered by PHPWind 5.0.1
Time 0.014426 second(s),query:3 Gzip enabled