Asp.net Request method for obtaining server Variables

Source: Internet
Author: User
Tags servervariables

 

HTTP_USER_AGENT: Obtain the browser type and version used by the user.

 

REMOTE_ADDR

 

REQUEST_METHOD

 

LOCAL_ADDR

 

SERVER_NAME: Obtain the server host name

 

PATH_INFO: Obtain the virtual path of the current executable program

 

PATH_TRANSLATED: Obtain the absolute path of the current execution Program

 

CONTENT_LENGTH obtains the total number of characters sent by the request program.

 

CONTENT_TYPE

 

GATEWAY_INTERFACE

 

QUERY_STRING get additional URL Information

 

SCRIPT_NAME: get the file name of the current program (including the Virtual Path)

 

SERVER_PORT: gets the port from which the server accepts the request.

 

SERVER_PROTOCOL: Obtain the protocol and version number that the server complies.

 

HTTP_ACCEPT_LANGUAGE: gets the language used by the user.

 

Response. Write ("browser type and version:" + Request. ServerVariables ["HTTP_USER_AGENT"] +"

")

 

Response. Write ("user's IP Address:" + Request. ServerVariables ["REMOTE_ADDR"] +"

")

 

Response. Write ("Request Method:" + Request. ServerVariables ["REQUEST_METHOD"] +"

")

 

Response. Write ("Server IP Address:" + Request. ServerVariables ["LOCAL_ADDR"] +"

")

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.