Server Side: Use code like...
... from within a web application server side to determine the requesting device type.
Client Side: Include...
var detectionProvider = new Provider(StreamFactory.Create("[DATA FILE LOCATION]")); var deviceType = detectionProvider.Match("[YOUR USERAGENT]")["DeviceType"];
... to perform offline analysis of web logs with User-Agent headers.
The simplest method of deploying 51Degrees device detection to a .NET project is with NuGet. Just search for 51Degrees on NuGet.
This GitHub repository and NuGet include 51Degrees free Lite device database. The Lite data is updated monthly by our professional team of analysts.
Data files which are updated weekly and daily, automatically, and with more properties and device combinationsare also available.
Version 3.2.14 Highlights
New Lite Data File released for December. Usage data is now shared securely over HTTPS getValues now uses a concurrent dictionary to improve performance.
Major Changes in Version 3.2
- Embedded data has been removed from the assembly and now must be provided from the App_Data folder.
- .NET 3.5 is not supported in this release in order to use memory mapped files and simplify overriding default browser capabilities.
- In stream mode entity data properties that can allocate large arrays only initialise these arrays when needed.
- Caches used with stream operation are now fixed memory size and serviced via the thread pool.
- Automatic update processes uses temporary files rather than main memory to verify integrity of updated files prior to using them.
- Temporary files are now created in the App_Data/51Degrees folder of the web application rather than a UNC path or the master data file folder.
- Values associated with Profiles are now retrieved using a more efficient algorithm.
- DataSet.Properties collection now has a string accesser to make retrieving properties by name simpler.
- Web sites using memory mode use a byte array to improve start up time.
- Version 3.2 data file formats are supported in parallel with version 3.1 data files.
- 51Degrees unit tests are now part of the open source distribution.
Changes from 3.2.5
Summary of API changes:
- Provider supports retrieving match results using device ids generated from previous matches.
- The classes to update device data files are now public and can be used to update device data files from non web environments.
- Licence keys are now verified against the 51Degrees public signature before being used to retrieve updates.
- The cache has been upgraded to use a least recently used (LRU) design. This removes the need to service the cache in a background thread, and results in a more predictable performance under load.
- Duplicate code has been consolidated with a focus on improving documentation and implementing recommendations from code analysis and peer reviews. Testing coverage has been included with initial unit tests for new features.
- Consistent examples have been added in parallel with APIs in other languages. The examples are designed to highlight specific use cases for the API. They relate to example specific documentation on the 51Degrees web site under Support -> Documentation -> .NET.
- The override to indicate if cookies are supported now defaults to True when the value is unknown. This prevents 3rd party components such as forms authentication from failing where an assumption that cookies are always supported has been made but not verified against the server side browser capabilities.
- The demo web site project no longer includes the 51Degrees.dat file in the project. It is instead copied from the repositories data folder when the project is built.
- The signed assembly is now compiled with "Optimise Code" option enabled.