0

I have a website created in asp.net 3.5, c# 2008 - hosted on IIS 7. I want to check from which operating system the client is accessing the site, whether from browser of computer or from browser of tablet devices like ipad, dell streak, samsung galaxy etc or from the smart phone. Is it possible to know. I have tried out

Page.Request.Browser.Platform.ToString(); 

but accessing from android device browser I am getting it undefined.

I also have tried

Request.Browser.Capabilities["OS"].ToString(); 

but for android I am getting the OS name Linux !!

I want the exact name whether it is windows, Symbian, Android, iOS, MAC or Linux.

4
  • Perhaps this answer might help: stackoverflow.com/a/5664612/141022 Commented Jun 28, 2012 at 12:52
  • @Alex Is it really safe to provide your request information to any third party web? Commented Jun 28, 2012 at 13:10
  • Probably not (kinda), but in a way you're sending the user agent string to Google Analytics (I'm guessing). I'm guessing that these 3rd party services / libraries work via a (probably difficult to maintain) database of user agents to the equivelant break down of os's etc. Commented Jun 28, 2012 at 13:49
  • @Alex actually I think we should not be dependent on any third party web or service as there might be some security threats are there and also if that website gets down or something else happens there, our service also gets stopped. I need some concrete solution within my application that if any issue occurs I can control it. Commented Jun 29, 2012 at 5:14

1 Answer 1

0

Try to get it from the useragent

Sign up to request clarification or add additional context in comments.

4 Comments

User agent for android shows both Linux and android. Like Mozilla/5.0 (Linux; U; Android 2.2.2; en-us;....). How can I make sure that from which OS is it?
split the useragent with ";" and take the value from index 2
Nope, It will not give you an exact answer each time. For my Android device it is giving me "U".
How about calling it android if it contains "Android", even if it also contains "Linux"? Then, just call it "Linux" if it has linux but not android?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.