Asp. NET to get the client browser information! __.net

Source: Internet
Author: User

The user is able to access the Httpbrowesercapabilities property using the browser property of the request's object to obtain which type of browser is currently being used to browse the Web page and to obtain whether the browser supports certain features. Here's an example of this.
The following example obtains browser information primarily through the browser property of the Request object.
The steps for program implementation are as follows:
Create a new Web site default home page Default.aspx. In Default.aspx Page_Load events, first define the Httpbrowser-capabilities class object to get the property return value of the browser of the Request object property. The code is as follows:
protected void Page_Load (object sender, EventArgs e)
{
HttpBrowserCapabilities B = request.browser;
Response.Write ("client browser information");
Response.Write ("Response.Write ("Type:" +b.type+ "<br>");
Response.Write ("Name:" +b.browser+ "<br>");
Response.Write ("Version:" +b.version+ "<br>");
Response.Write ("Operating Platform:" +b.platform+ "<br>");
Response.Write ("Support Framework:" +b.frames+ "<br>");
Response.Write ("Support form" +b.tables+ "<br>");
Response.Write ("Whether to support Cookies" +b.cookies+ "<br>");
Response.Write ("     }

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.