c# - How do I check if the useragent is an ipad or iphone? -


i'm using c# asp.net website.

how can check if user using ipad or iphone? how can check platform?

for example, if user enter website ipad i'd display"hello ipad user"

for ipad user agent like:

mozilla/5.0(ipad; u; cpu iphone os 3_2 mac os x; en-us) applewebkit/531.21.10 (khtml, gecko) version/4.0.4 mobile/7b314 safari/531.21.10

and iphone somthing like:

mozilla/5.0 (iphone; u; cpu mac os x; en) applewebkit/420+ (khtml, gecko) version/3.0 mobile/1a543a safari/419.3

any many more depending on version , wheather iphone 3 or 4

so better substring search iphone , ipad as suggested answer


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -