使用ASP.NET 3.5 C将iPhone重定向到另一个URL#

Fog*_*ogh 2 c# asp.net iphone

如何检查浏览我的网站的用户是否使用iPhone,然后将用户重定向到另一个URL?

SLa*_*aks 7

像这样:

if(Request.UserAgent.IndexOf("iPhone") > 0)
    Response.Redirect("~/iPhone/");
Run Code Online (Sandbox Code Playgroud)

iPhone的用户代理是

Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) 
AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3