Example Analysis of ASP.NET system object Request
This article mainly shows you the "ASP.NET system object Request example analysis", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and study the "ASP.NET system object Request sample analysis" this article.
Request object
Used to get all the information that the client provides when requesting a page or transmitting a Form. It includes the user's HTTP variable, the recognizable browser, the storage client's Cookie information and the request address and so on.
The Request object is an object of the System.Web.httpRequest class, and its
Common properties are as follows:
QueryString: gets a collection of HTTP query string variables, which is mainly used to collect data sent by Get requests in the HTTP protocol
Form: gets a collection of form or page variables to collect request data sent by the Post method
ServerVarible: a collection of environment variables contains intra-system information for both the server and the client
Params: it is a collection of QueryString, Form, and ServerVarible, regardless of which way the parameters are passed
Url: get URL information about the current request
UserHostName: gets the DNS name of the remote client
UserHostAddress: get the IP host address of the remote client
IsLocal: gets a value indicating whether the request is from the local computer
Browser: gets or sets information about the client browser feature being requested
The common methods are as follows:
BinaryRead (): performs a binary read of the specified number of bytes of the current input stream
SaveAs (): save the HTTP request to 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:
The above is all the content of the article "sample Analysis of ASP.NET system object Request". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!