'서버변수'에 해당되는 글 1건

  1. 2009.03.13 서버변수를 알아보자//

서버변수를 알아보자//

.Net 2009. 3. 13. 15:27 posted by 무명시인
Request.ServerVariables['key'] 로 값을 가져올수있는 컬렉션 목록입니다..
Key Value
ALL_HTTP HTTP_CONNECTION:Keep-Alive HTTP_ACCEPT:*/* HTTP_ACCEPT_ENCODING:gzip, deflate HTTP_ACCEPT_LANGUAGE:ko HTTP_HOST:localhost HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
ALL_RAW Connection: Keep-Alive Accept: */* Accept-Encoding: gzip, deflate Accept-Language: ko Host: localhost User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
APPL_MD_PATH /LM/w3svc/1/ROOT/Web
APPL_PHYSICAL_PATH D:\NetV20\Web\
AUTH_TYPE
AUTH_USER
AUTH_PASSWORD
LOGON_USER
REMOTE_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
PATH_INFO /Web/NET/ServerVariable.aspx
PATH_TRANSLATED D:\NetV20\Web\NET\ServerVariable.aspx
QUERY_STRING
REMOTE_ADDR 127.0.0.1
REMOTE_HOST 127.0.0.1
REMOTE_PORT 2763
REQUEST_METHOD GET
SCRIPT_NAME /Web/NET/ServerVariable.aspx
SERVER_NAME localhost
SERVER_PORT 80
SERVER_PORT_SECURE 0
SERVER_PROTOCOL HTTP/1.1
SERVER_SOFTWARE Microsoft-IIS/5.1
URL /Web/NET/ServerVariable.aspx
HTTP_CONNECTION Keep-Alive
HTTP_ACCEPT */*
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_ACCEPT_LANGUAGE ko
HTTP_HOST localhost
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)






protected Table Table1;
 private NameValueCollection coll;

 private void Page_Load(object sender, System.EventArgs e)
 {
  coll = Request.ServerVariables;
  String[] arrKeys = coll.AllKeys;

  SPList.Text = "<table width='100%' border='1' cellSpacing='0' cellPadding='5'>";
        SPList.Text += "<tr><td>Key</td><td>Value</td></tr>";

  for (int i = 0; i < arrKeys.Length; i++)
  {
            String[] arrVals = coll.GetValues(arrKeys[i]);

            SPList.Text += "<tr><td>" + arrKeys[i] + "</td>";
            SPList.Text += "<td>";

   for (int j = 0; j < arrVals.Length; j++)
   {
    SPList.Text += arrVals[j] + "<br />";
   }

   SPList.Text += "</td></tr>";
  }

  SPList.Text += "</table>";
 }

<< prev 1 next >>