<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