C # get browser information

Source: Internet
Author: User

Request.Browser.MajorVersion.ToString ()///Get the client browser (main) version number Request.Browser.Version.ToString ();//Get the full version number of the client browser
Request.Browser.Platform.ToString ()//Get the name of the client using the platform
Request.UserHostAddress.ToString (); Get remote Client host IP

Httprequest.url gets information about the URL of the current request.
Httprequest.urlreferrer gets information about the URL that was last requested by the client, which is linked to the current URL.
Httprequest.useragent gets the original user agent information for the client browser.
Httprequest.userhostaddress Gets the IP host address of the remote client.
Httprequest.userhostname gets the DNS name of the remote client.
Httprequest.userlanguages gets an array of sorted strings for client language preferences.

System.Text.StringBuilder Strlabel = new System.Text.StringBuilder ();
httpbrowsercapabilities BC = Request.Browser;
Strlabel.append ("Your browser's resolution is:");
Strlabel.append (request.form["Widthpixel"]);
Strlabel.append ("X");
Strlabel.append (request.form["Heightpixel"]);
Strlabel.append ("");
Strlabel.append ("Browser basic information:");
Strlabel.append ("Type =" + BC.) Type + "");
Strlabel.append ("Name =" + BC.) Browser + "");
Strlabel.append ("Version =" + BC.) Version + "");
Strlabel.append ("Major Version =" + BC.) MajorVersion + "");
Strlabel.append ("Minor Version =" + BC.) MinorVersion + "");
Strlabel.append ("Platform =" + BC.) Platform + "");
Strlabel.append ("is Beta =" + BC.) Beta + "");
Strlabel.append ("is Crawler =" + BC.) Crawler + "");
Strlabel.append ("is AOL =" + BC.) AOL + "");
Strlabel.append ("is Win16 =" + BC.) Win16 + "");
Strlabel.append ("is Win32 =" + BC.) Win32 + "");
Strlabel.append ("Support Frames =" + BC.) Frames + "");
Strlabel.append ("Support Tables =" + BC.) Tables + "");
Strlabel.append ("Support Cookies =" + BC.) Cookies + "");
Strlabel.append ("Support VB Script =" + BC.) VBScript + "");
Strlabel.append ("Support JavaScript =" + BC.) JavaScript + "");
Strlabel.append ("Support Java Applets =" + BC.) Javaapplets + "");
Strlabel.append ("Support ActiveX Controls =" + BC.) ActiveXControls + "");
Strlabel.append ("CDF =" + BC.) CDF + "");
Strlabel.append ("w3cdomversion =" + BC.) W3cdomversion.tostring () + "");
Strlabel.append ("useragent =" + Request.useragent + "");
Strlabel.append ("userlanguages =" + request.userlanguages[0]. ToString () + "");
Strlabel.append ("");
Strlabel.append ("Client computer Basic configuration:");
Strlabel.append ("userhostname =" + Request.userhostname + "");
Strlabel.append ("userhostaddress =" + request.userhostaddress + "");
Strlabel.append ("PDF 6.0 plugin is installed =" + request.form["PDF"] + "");
Label1.Text = Strlabel.tostring ();
}
}

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.