Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Each 51Degrees device data file contains information like the
- * next update date, published date and other useful information.
- *
- * The following snippet demonstrates how this information can be
- * retrieved using a Default.aspx web page as an example.
- *
- * Snippet contains 2 parts: the HTML markup and the code behind.
- */
- /* Web Forms .NET example of retrieving 51Degrees device data file information */
- /* Default.aspx */
- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <div>
- <asp:Label runat="server" ID="Type"></asp:Label>
- <asp:Label runat="server" ID="Version"></asp:Label>
- <asp:Label runat="server" ID="Published"></asp:Label>
- <asp:Label runat="server" ID="NextUpdate"></asp:Label>
- <asp:Label runat="server" ID="Properties"></asp:Label>
- <asp:Label runat="server" ID="Combination"></asp:Label>
- </div>
- </div>
- </form>
- </body>
- </html>
- /* Default.aspx.cs */
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- 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;
- Type.Text = "Type: " + p.DataSet.Name + "<br>";
- Version.Text = "Version: " + p.DataSet.Version + "<br>";
- Published.Text = "Published: " + p.DataSet.Published + "<br>";
- NextUpdate.Text = "Next update: " + p.DataSet.NextUpdate + "<br>";
- Properties.Text = "Properties: " + p.DataSet.Properties.Count + "<br>";
- Combination.Text = "Device combinations: " + p.DataSet.DeviceCombinations + "<br>";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement