各种语言推断是否是手机设备

这个网址是各种语言的推断是否是手机设备


http://detectmobilebrowsers.com/


举例:C#推断是否是


  protected void Page_Load(object sender, EventArgs e)
        {
            string[] mobileAgents = { "iphone",
                                      "ipad",
                                      "midp",
                                      "ucweb",
                                      "rv:1.2.3.4",
                                      "android", 
                                      "phone", 
                                      "mobile", 
                                      "wap", 
                                      "netfront", 
                                      "java", 
                                      "opera mobi", 
                                      "opera mini", 
                                      "ucweb", 
                                      "windows ce", 
                                      "symbian", 
                                      "series", 
                                      "webos", 
                                      "sony", 
                                      "blackberry", 
                                      "dopod", 
                                      "nokia", 
                                      "samsung", 
                                      "palmsource", 
                                      "xda", 
                                      "pieplus", 
                                      "meizu", 
                                      "midp", 
                                      "cldc", 
                                      "motorola", 
                                      "foma", 
                                      "docomo", 
                                      "up.browser", 
                                      "up.link", 
                                      "blazer", 
                                      "helio", 
                                      "hosin", 
                                      "huawei", 
                                      "novarra", 
                                      "coolpad", 
                                      "webos", 
                                      "techfaith", 
                                      "palmsource", 
                                      "alcatel", 
                                      "amoi", 
                                      "ktouch", 
                                      "nexian", 
                                      "ericsson", 
                                      "philips", 
                                      "sagem", 
                                      "wellcom", 
                                      "bunjalloo", 
                                      "maui", 
                                      "smartphone", 
                                      "iemobile", 
                                      "spice", 
                                      "bird", 
                                      "zte-",
                                      "longcos",
                                      "pantech", 
                                      "gionee", 
                                      "portalmmm", 
                                      "jig browser", 
                                      "hiptop", 
                                      "benq", 
                                      "haier", 
                                      "^lct",
                                      "320x320",
                                      "240x320",
                                      "176x220",
                                      "w3c ", 
                                      "acs-", 
                                      "alav", 
                                      "alca", 
                                      "amoi",
                                      "audi",
                                      "avan", 
                                      "benq", 
                                      "bird", 
                                      "blac", 
                                      "blaz", 
                                      "brew",
                                      "cell",
                                      "cldc",
                                      "cmd-",
                                      "dang", 
                                      "doco",
                                      "eric",
                                      "hipt",
                                      "inno", 
                                      "ipaq",
                                      "java", 
                                      "jigs", 
                                      "kddi",
                                      "keji", 
                                      "leno",
                                      "lg-c", 
                                      "lg-d",
                                      "lg-g", 
                                      "lge-", 
                                      "maui",
                                      "maxo",
                                      "midp", 
                                      "mits", 
                                      "mmef", 
                                      "mobi", 
                                      "mot-",
                                      "moto", 
                                      "mwbp", 
                                      "nec-",
                                      "newt",
                                      "noki", 
                                      "oper",
                                      "palm",
                                      "pana",
                                      "pant",
                                      "phil",
                                      "play", 
                                      "port",
                                      "prox", 
                                      "qwap", 
                                      "sage",
                                      "sams",
                                      "sany", 
                                      "sch-", 
                                      "sec-", 
                                      "send",
                                      "seri",
                                      "sgh-",
                                      "shar",
                                      "sie-",
                                      "siem", 
                                      "smal", 
                                      "smar",
                                      "sony", 
                                      "sph-",
                                      "symb", 
                                      "t-mo", 
                                      "teli", 
                                      "tim-", 
                                      "tosh", 
                                      "tsm-", 
                                      "upg1", 
                                      "upsi", 
                                      "vk-v", 
                                      "voda",
                                      "wap-", 
                                      "wapa", 
                                      "wapi", 
                                      "wapp",
                                      "wapr",
                                      "webc", 
                                      "winw", 
                                      "winw", 
                                      "xda",
                                      "xda-",
                                      "Googlebot-Mobile" };
            if (Request.UserAgent.ToString().ToLower() != null)
            {
                for (int i = 0; i < mobileAgents.Length; i++)
                {
                    if (Request.UserAgent.ToString().ToLower().IndexOf(mobileAgents[i]) > 0)
                    {
                        Response.Redirect("http://m.meten.com/");
                        break;
                    }
                }
            } 
}

假设须要其他语言的。进入上面提供的网址

posted @ 2017-05-23 15:19  wzjhoutai  阅读(136)  评论(0编辑  收藏  举报