Asp.net System Object Request (1), asp. netrequest

Source: Internet
Author: User

Asp.net System Object Request (1), asp. netrequest

Request object

  It is used to obtain all the information provided by the client when requesting a page or sending a Form.It includes the user's HTTP variables, recognizable browsers, Cookie information of the storage client, and request address.

The Request object is an object of the System. Web. httpRequest class, and its

Common attributes are as follows:

QueryString: a collection of HTTP query string variables. It is mainly used to collect data sent by Get requests in HTTP.

Form: a collection of Form or page variables used to collect request data sent by the Post method.

ServerVarible: The environment variable set contains the system information of the server and client.

Params: it is a set of QueryString, Form, and ServerVarible methods. It does not distinguish the parameter passing method.

Url: Get URL information about the current request

UserHostName: Get the DNS name of the remote client

UserHostAddress: obtains the IP address of the remote client host.

IsLocal: gets a value indicating whether the request comes from a local computer.

Browser: gets or sets information about the client Browser being requested.

The common method is as follows:

BinaryRead (): Binary reads of the specified number of bytes of the current input stream.

SaveAs (): Save the HTTP request to the disk.

 

Some attributes:

protected void Page_Load(object sender, EventArgs e)        {            Textbox1.Text = Request.Browser.Browser;            Textbox2.Text = Request.Url.ToString();            Textbox3.Text = Request.ContentLength.ToString();            Textbox4.Text = Request.FilePath;            Textbox5.Text = Request.HttpMethod;            Textbox6.Text = Request.UserHostName;        }

Output result:

 

Conclusion: Request is used to obtain various client information.

 

 

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.