I have to send User-agent to the server from my app.
“Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; HTC; HD7 T9292)”
The above is a sample user-agent. I have no idea. What are all the values we can get programmatically in order to form the user-agent.
That looks like the user agent of IE7 mobile on a HD7. I’m assuming that you are not writing IEMobile and so your app will have a different user agent name/identifier. If you’re making web requests from your app then your app is a different user agent to the built in browser.
The SDK does not expose a way of getting all the individual elements that make up the user agent in your sample.
If you really wanted to get the user agent of the browser, from within your app, the best you could probably do would be to include a WebBrowser control and then extract it via Javascript with
navigator.userAgentbut I don’t know if it’s supported. If it is supported you could pass it back to your code behind usingwindows.external.notify.