Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET lib for interpreting user agent strings [closed]

Are there and .NET libs out there that will interpret stored user agent strings and give you a nice strongly typed object with the contained information?

like image 435
Mr. Flibble Avatar asked Sep 08 '10 09:09

Mr. Flibble


People also ask

How do you read a user agent?

A User Agent (UA) string is a type of HTTP header request that contains information on the device. For example, if you browse the web on your smartphone, your device will send a HTTP request header to the web server, saying that it is a mobile device.

What is Mozilla 5.0 userAgent?

Mozilla/5.0 is the general token that says the browser is Mozilla compatible, and is common to almost every browser today. platform describes the native platform the browser is running on (e.g. Windows, Mac, Linux or Android), and whether or not it's a mobile phone.

What is userAgent in Httpwebrequest?

The User Agent is used to identify the client and operating system etc.

What is Http_user_agent?

It's just a string that a browser optionally sends to the server. Firefox can let you change the string entirely via the about:config page by modifying/creating the string general. useragent.


2 Answers

        var browserCapabilities = new HttpBrowserCapabilities         {             Capabilities = new Hashtable { { string.Empty, userAgent } }         };          var capabilitiesFactory = new BrowserCapabilitiesFactory();          capabilitiesFactory.ConfigureBrowserCapabilities(new NameValueCollection(), browserCapabilities);          return browserCapabilities; 
like image 89
Umar Topia Avatar answered Sep 20 '22 12:09

Umar Topia


You could try this ua-parser it seems to be updated fairly often!

Edit: It seems ua-parser is more or less dead now, DeviceDetector.NET seems to be in active development.

like image 30
Peter Avatar answered Sep 19 '22 12:09

Peter