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

前端 未结 9 2555
礼貌的吻别
礼貌的吻别 2020-12-09 14:42

I\'m using a C# asp.net website.

How can I check if the user using ipad or iphone? How can I check the platform?

For example, if the user enter the websi

9条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-09 15:27

    The user-agent for these devices includes "iPod", "iPad" or "IPhone" as appropriate. Note that there are several user agents in play, so an exact match is unwise - but have a look from your device at http://whatsmyuseragent.com

    So check the user-agent in the headers.

提交回复
热议问题