HTTP头信息

protected void Page_Load(object sender, EventArgs e)
{        
    System.Text.StringBuilder htmlStr 
= new System.Text.StringBuilder();
    
foreach (string key in Request.Headers.AllKeys) 
    {
        htmlStr.Append(key 
+ "" + Request.Headers[key] + "<br />");
    }
    Literal1.Text 
= htmlStr.ToString();
}
上面的代码输出如下内容:
Connection:Keep-Alive
Accept:*/*
Accept-Encoding:gzip, deflate
Accept-Language:zh-cn
Host:localhost:8556
User-Agent:Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; CIBA; .NET CLR 3.5.21022; InfoPath.2)
UA-CPU:x86
我自己解释不好,欢迎高手们讨论。
posted @ 2009-01-14 08:40  文明的天空  阅读(169)  评论(0编辑  收藏  举报