Check out the latest documentation.

.NET Usage Examples

On this page you will find some sample code and explanations of how 51Degrees device detecor can be used. New entries are usually added based on support requests.

Table of contents

  1. How to find the next update date for my data file?
  2. How do I use earlier/later version of Lite data file?

1. How to find the next update date for my data file?

Enterprise and Premium data files contain the date when the next data update will be released. This information can be accessed via the NextUpdate of the DataSet object.

										
										using
										
										
										FiftyOne.Foundation.Mobile.Detection
										
									;


										
										public
										
										
										partial
										
										
										class
										
										
										_Default
										
									 : System.Web.UI.Page
{
    
										
										protected
										
										
										void
										
										
										Page_Load
										
									(
										
										object
										
									 sender, EventArgs e)
    {
        Provider p = WebProvider.ActiveProvider;
        
										
										//l1 is the asp:label html element.
										
									
        l1.Text = p.DataSet.NextUpdate.ToString();
    }
}

									

2. How do I use earlier/later version of Lite data file?

Lite data file is built in to the detector and new versions are usually distributed with detector updates. If you wish to use an earlier or later version of the Lite data file for whatever reason, all you need to do is specify path to the data file in the detection section of 51Degrees.config as follows:

										
										<detection
										
										
										enabled=
										
										
										"true"
										
										
										autoUpdate=
										
										
										"true"
										
										
										binaryFilePath=
										
										
										"~/App_Data/51Degrees-Lite.dat"
										
										
										/>