|
<< Click to Display Table of Contents >> Mobile - saber se está rodando em dispositivo |
![]() ![]()
|
private bool IsMobile()
{
if (Request.Browser.IsMobileDevice)
return true;
string userAgent = Request.UserAgent.ToLower();
string[] sistemas = new string[] { "blackberry", "symbian", "nokia", "phone", "samsung", "HTC", "sony", "lg", "iphone", "android" };
foreach (string s in sistemas)
if (userAgent.Contains(s))
return true;
return false;
}