views:

1360

answers:

4

Hi everybody,

I want to get the os version that the browser opens, actually my project is an asp.net project and i want to know which operating system runs on the client but there is a question about it. Because the client will use xp but at the same time will use Windows CE 5.0, so the internet explorer in Windows CE is not as good as the one in xp, because of it i'll redirect the user to the page that i designed for Windows CE. So is there any solution to do it?

Thank you..

A: 

The USER_AGENT parameter (on of the request parameters) should tell the story.

Assaf Lavie
A: 

A quick web search turned up this.

The gist of it is use Request.Browser.Platform, and the version is in Request.UserAgent.

Tim Sullivan
+4  A: 

Use Request.UserAgent - that will probably give all the information you need.

There's a "List of User-Agents" web site which gives lots of sample strings, but if your client has a limited range of setups, it would be worth just trying each of them and logging the user agent as a preliminary step.

Be aware that many browsers will allow you to "spoof" the user agent string, so you mustn't use this for security purposes - but it sounds as if your use case is pretty reasonable.

Jon Skeet
A: 

i used this and it works just fine. I have used it in one of my apps.

http://blogs.microsoft.co.il/blogs/rotemb/archive/2009/01/26/browser-and-operating-system-detection-in-asp-net.aspx

Prashant Atal