Request.ServerVariables

ALL_HTTP : HTTP_CONNECTION:Keep-Alive HTTP_ACCEPT:image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-silverlight, application/x-silverlight-2-b2, */* HTTP_ACCEPT_ENCODING:gzip, deflate HTTP_ACCEPT_LANGUAGE:zh-cn HTTP_COOKIE:AJSTAT_ok_times=2; rtime=1; ltime=1238740829016; cnzz_eid=27893614-1237971444-; ASPSESSIONIDQCTAQAAC=HCFFOIBCNGNKFBKLBEKDKNDM HTTP_HOST:localhost HTTP_REFERER:http://localhost/Request.asp HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727) HTTP_UA_CPU:x86
ALL_RAW : Connection: Keep-Alive Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-silverlight, application/x-silverlight-2-b2, */* Accept-Encoding: gzip, deflate Accept-Language: zh-cn Cookie: AJSTAT_ok_times=2; rtime=1; ltime=1238740829016; cnzz_eid=27893614-1237971444-; ASPSESSIONIDQCTAQAAC=HCFFOIBCNGNKFBKLBEKDKNDM Host: localhost Referer: http://localhost/Request.asp User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727) UA-CPU: x86
APPL_MD_PATH : /LM/W3SVC/1/ROOT
APPL_PHYSICAL_PATH : c:\inetpub\wwwroot\
AUTH_PASSWORD :
AUTH_TYPE :
AUTH_USER :
CERT_COOKIE :
CERT_FLAGS :
CERT_ISSUER :
CERT_KEYSIZE :
CERT_SECRETKEYSIZE :
CERT_SERIALNUMBER :
CERT_SERVER_ISSUER :
CERT_SERVER_SUBJECT :
CERT_SUBJECT :
CONTENT_LENGTH : 0
CONTENT_TYPE :
GATEWAY_INTERFACE : CGI/1.1
HTTPS : off
HTTPS_KEYSIZE :
HTTPS_SECRETKEYSIZE :
HTTPS_SERVER_ISSUER :
HTTPS_SERVER_SUBJECT :
INSTANCE_ID : 1
INSTANCE_META_PATH : /LM/W3SVC/1
LOCAL_ADDR : 127.0.0.1
LOGON_USER :
PATH_INFO : /request.asp
PATH_TRANSLATED : c:\inetpub\wwwroot\request.asp
QUERY_STRING :
REMOTE_ADDR : 127.0.0.1
REMOTE_HOST : 127.0.0.1
REMOTE_USER :
REQUEST_METHOD : GET
SCRIPT_NAME : /request.asp
SERVER_NAME : localhost
SERVER_PORT : 80
SERVER_PORT_SECURE : 0
SERVER_PROTOCOL : HTTP/1.1
SERVER_SOFTWARE : Microsoft-IIS/6.0
URL : /request.asp
HTTP_CONNECTION : Keep-Alive
HTTP_ACCEPT : image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-silverlight, application/x-silverlight-2-b2, */*
HTTP_ACCEPT_ENCODING : gzip, deflate
HTTP_ACCEPT_LANGUAGE : zh-cn
HTTP_COOKIE : AJSTAT_ok_times=2; rtime=1; ltime=1238740829016; cnzz_eid=27893614-1237971444-; ASPSESSIONIDQCTAQAAC=HCFFOIBCNGNKFBKLBEKDKNDM
HTTP_HOST : localhost
HTTP_REFERER : http://localhost/Request.asp
HTTP_USER_AGENT : Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
HTTP_UA_CPU : x86

Asp 中Request.ServerVariables 的遍历:

<%
    for Each key in Request.ServerVariables
        Response.Write "<b>" & key & "</b> : <font color=red>" & Request.ServerVariables(key) & "</font><br/>"
    Next
     %>

C#中 Request.ServerVariables 的遍历:

 <div>
   <b>Request.ServerVariables遍历</b>
   <br />
   <br />
   <%foreach(object obj in Request.ServerVariables)
     {
         string name = obj.ToString();
   %>
     Request.ServerVariables["<%=name%>"]:<span style="color:Red"><%=Request.ServerVariables[name]%></span>
     <br />
   <%} %>
</div>  

posted on 2009-04-08 13:19  沉默的心  阅读(1886)  评论(0编辑  收藏  举报