Request.ServerVariables中变量意义.

来源:互联网 发布:网络语cx是什么意思 编辑:程序博客网 时间:2024/05/17 23:06
准备作一个计数器,
今天用到了,
找了好久好久,
知道了一点。
如果谁还知道给我留言。

Request.ServerVariables["HTTP_VIA"]---------可以获得用户内部的ip
Request.ServerVariables["HTTP_X_FORWARDED_FOR"]---------可以知道代理服务器的服务器名以及端口
上面两个经过测试怎么没有显示呢?奇怪阿,这两个是做什么用的呢????

HttpRequest.ServerVariables["REMOTE_ADDR"] 就可以取得瀏覽者的IP Address ,如218.56.56.206

HttpRequest.ServerVariables["URL"]可以获得用户请求的URL信息,比如,如果请求http://www.coofucoo.com/yonoworks/test.aspx
则获得的信息为URL:/yonoworks/test.aspx

HttpRequest.ServerVariables["HTTP_HOST"]可以获得主机信息,比如,如果请求
http://www.coofucoo.com/yonoworks/test.aspx
则获得的信息为HTTP_HOST:www.coofucoo.com
原创粉丝点击