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?
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.
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.
The User Agent is used to identify the client and operating system etc.
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.
var browserCapabilities = new HttpBrowserCapabilities { Capabilities = new Hashtable { { string.Empty, userAgent } } }; var capabilitiesFactory = new BrowserCapabilitiesFactory(); capabilitiesFactory.ConfigureBrowserCapabilities(new NameValueCollection(), browserCapabilities); return browserCapabilities;
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With