ASP.NET(C#)

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
ClientIP:   
this.Label1.Text = Request.ServerVariables["remote_addr"].ToString();
LocalIP:
this.Label1.Text = Request.ServerVariables["LOCAL_ADDR"].ToString();

------------------------------------------------------------------------------------------------------
详见:
Key: ALL_HTTP
Value 0: HTTP_CACHE_CONTROL:no-cache HTTP_CONNECTION:Keep-Alive HTTP_CONTENT_LENGTH:100 HTTP_CONTENT_TYPE:application/x-www-form-urlencoded 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, */* HTTP_ACCEPT_ENCODING:gzip, deflate HTTP_ACCEPT_LANGUAGE:zh-cn HTTP_COOKIE:XframeWebLogin=XframeWebLogin=127001127001xframe47989; ASP.NET_SessionId=ksplbw551t3vruesoxf3ok45 HTTP_HOST:localhost HTTP_REFERER:http://localhost/Demo/CheckIP.aspx HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MyIE2; Maxthon; .NET CLR 1.1.4322)
Key: ALL_RAW
Value 0: Cache-Control: no-cache Connection: Keep-Alive Content-Length: 100 Content-Type: application/x-www-form-urlencoded Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* Accept-Encoding: gzip, deflate Accept-Language: zh-cn Cookie: XframeWebLogin=XframeWebLogin=127001127001xframe47989; ASP.NET_SessionId=ksplbw551t3vruesoxf3ok45 Host: localhost Referer: http://localhost/Demo/CheckIP.aspx User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MyIE2; Maxthon; .NET CLR 1.1.4322)
Key: APPL_MD_PATH
Value 0: /LM/w3svc/1/root/Demo
Key: APPL_PHYSICAL_PATH
Value 0: c:\inetpub\wwwroot\Demo\
Key: AUTH_TYPE
Value 0:
Key: AUTH_USER
Value 0:
Key: AUTH_PASSWORD
Value 0:
Key: LOGON_USER
Value 0:
Key: REMOTE_USER
Value 0:
Key: CERT_COOKIE
Value 0:
Key: CERT_FLAGS
Value 0:
Key: CERT_ISSUER
Value 0:
Key: CERT_KEYSIZE
Value 0:
Key: CERT_SECRETKEYSIZE
Value 0:
Key: CERT_SERIALNUMBER
Value 0:
Key: CERT_SERVER_ISSUER
Value 0:
Key: CERT_SERVER_SUBJECT
Value 0:
Key: CERT_SUBJECT
Value 0:
Key: CONTENT_LENGTH
Value 0: 100
Key: CONTENT_TYPE
Value 0: application/x-www-form-urlencoded
Key: GATEWAY_INTERFACE
Value 0: CGI/1.1
Key: HTTPS
Value 0: off
Key: HTTPS_KEYSIZE
Value 0:
Key: HTTPS_SECRETKEYSIZE
Value 0:
Key: HTTPS_SERVER_ISSUER
Value 0:
Key: HTTPS_SERVER_SUBJECT
Value 0:
Key: INSTANCE_ID
Value 0: 1
Key: INSTANCE_META_PATH
Value 0: /LM/W3SVC/1
Key: LOCAL_ADDR
Value 0: 127.0.0.1
Key: PATH_INFO
Value 0: /Demo/CheckIP.aspx
Key: PATH_TRANSLATED
Value 0: c:\inetpub\wwwroot\Demo\CheckIP.aspx
Key: QUERY_STRING
Value 0:
Key: REMOTE_ADDR
Value 0: 127.0.0.1
Key: REMOTE_HOST
Value 0: 127.0.0.1
Key: REMOTE_PORT
Value 0: 1208
Key: REQUEST_METHOD
Value 0: POST
Key: SCRIPT_NAME
Value 0: /Demo/CheckIP.aspx
Key: SERVER_NAME
Value 0: localhost
Key: SERVER_PORT
Value 0: 80
Key: SERVER_PORT_SECURE
Value 0: 0
Key: SERVER_PROTOCOL
Value 0: HTTP/1.1
Key: SERVER_SOFTWARE
Value 0: Microsoft-IIS/5.1
Key: URL
Value 0: /Demo/CheckIP.aspx
Key: HTTP_CACHE_CONTROL
Value 0: no-cache
Key: HTTP_CONNECTION
Value 0: Keep-Alive
Key: HTTP_CONTENT_LENGTH
Value 0: 100
Key: HTTP_CONTENT_TYPE
Value 0: application/x-www-form-urlencoded
Key: HTTP_ACCEPT
Value 0: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Key: HTTP_ACCEPT_ENCODING
Value 0: gzip, deflate
Key: HTTP_ACCEPT_LANGUAGE
Value 0: zh-cn
Key: HTTP_COOKIE
Value 0: XframeWebLogin=XframeWebLogin=127001127001xframe47989; ASP.NET_SessionId=ksplbw551t3vruesoxf3ok45
Key: HTTP_HOST
Value 0: localhost
Key: HTTP_REFERER
Value 0: http://localhost/Demo/CheckIP.aspx
Key: HTTP_USER_AGENT
Value 0: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MyIE2; Maxthon; .NET CLR 1.1.4322)
posted on 2005-04-19 08:31  battlerstar  阅读(730)  评论(0编辑  收藏  举报