Retrieve browser details using C#.Net

This C#.Net tutorial explains, how to get browser details like browser name, browser version, etc using C#.Net.

Retrieve browser details using C#.Net

C#.Net provides HttpBrowserCapabilities class to interact with browser properties. This class present in System.Web namespace. So before using the HttpBrowserCapabilities we need to import the namespace.

Full code:

lblBrowserDetails.Text = “Browser name: ” + Request.Browser.Browser
+ ” Browser Type: ” + Request.Browser.Type
+ ” Browser Version :” + Request.Browser.Version
+ ” Browser Major Version: ” + Request.Browser.MajorVersion
+ ” Browser Minor Version: ” + Request.Browser.MinorVersion
+ ” Is Browser in Beta version? ” + Request.Browser.Beta;

The output will be like below:

Internet Explorer:
Browser name: IE Browser Type: IE8 Browser Version: 8.0 Browser Major Version: 8 Browser Minor Version: 0 Is Browser in Beta version? False

Mozilla Firefox:
Browser name: Firefox Browser Type: Firefox15 Browser Version: 15.0 Browser Major Version: 15 Browser Minor Version: 0 Is Browser in Beta version? False

Google Chrome:
Browser name: Chrome Browser Type: Chrome21 Browser Version: 21.0 Browser Major Version: 21 Browser Minor Version: 0 Is Browser in Beta version? False

You may like following C#.Net tutorials:

Hope this C#.net tutorial explains how to get browser details like browser name, browser version, etc using C#.Net.

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

>