How to get client information in ASP.NET, i.e. browser, resolution and OS?

I need to get client statistics for the browser (not a full long description, but short names, usually firefox, ie6, ie7, ie8, safari, chrome, opera and mozilla). Client and OS permission, i.e. Windows Vista, Ubuntu ....

thank

+5
source share
1 answer

You can get the name of the browser using Request.Browser.Browser. A Request.Browserlot more could also appear in a class :

var browserName = Request.Browser.Browser; // Would return IE, etc
var browserType = Request.Browser.Type; // Would return IE7, IE8, etc.
var browserMajor = Request.Browser.MajorVersion;
var browserMinor = Request.Browser.MinorVersion;

var supportsActiveX = Request.Browser.ActiveXControls;
var inputType = Request.Browser.InputType;
var supportsColours = Request.Browser.IsColor;
var isMobileDevice = Request.Browser.IsMobileDevice;
var supportsJavaApplets = Request.Browser.JavaApplets;
var ...

ASP.Net - , . , JS URL, :

var resolution = screen.width + ' x ' + screen.height;
hiddenField.value = resolution;
+7

All Articles