Determine if a mobile device is logged on

Source: Internet
Author: User

<summary>
Determine if a mobile device is logged on
</summary>
<returns></returns>
public static bool IsMobileDevice ()
{
String[] mobileagents = {"iphone", "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", "p Hilips "," Sagem "," wellcom "," Bunjalloo "," Maui "," Smartphone "," Iemobile "," Spice "," Bird "," zte-"," Longcos "," Pantech " , "Gionee", "portalmmm", "Jig Browser", "Hiptop", "BenQ", "Haier", "^LCT", "320x320", "240x320", "176x220", "the" "The", "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", "M IDP "," 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", "W EBC "," winw "," winw "," XDA "," xda-"," Googlebot-mobile "};
BOOL Ismoblie = false;
if (HttpContext.Current.Request.UserAgent.ToString (). ToLower ()! = null)
{
for (int i = 0; i < mobileagents.length; i++)
{
if (HttpContext.Current.Request.UserAgent.ToString (). ToLower (). IndexOf (Mobileagents[i]) >= 0)
{
Ismoblie = true;
Break
}
}
}
if (Ismoblie)
{
return true;
}
Else
{
return false;
}
}

Determine if a mobile device is logged on

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.