(X) Hide this
    • Login
    • Join
      • Say No Bots Generate New Image
        By clicking 'Register' you accept the terms of use .

How to Get the Windows Phone User Agent String

(0 votes)
0 comments   /   posted by Silverlight Show on Jul 06, 2012
Tags:   windows-phone , matt-hidinger

Read original post at Matt Hidinger's Blog

On a recent project I needed to extract the windows phone user-agent string for our usage analytics, and it had to be the same user-agent as the IE requests. While this didn’t end up being as straight forward and I had hoped, the code below involves a few simple steps. First we have to insert a collapsed browser onto the page, then we can navigate it to specifically crafted HTML/JavaScript, which will in-turn notify the WebBrowser control of it’s user-agent. All you need to do is store it somewhere; in my case, I put it into a custom ApplicationSettings class, but you can store it anywhere you want.


Comments

No comments

Add Comment

Login to comment:
  *      *       

Our News on Twitter