正则判断是不是移动端浏览
public bool IsMobile() { Regex RegexMobile = new Regex(@"(iemobile|iphone|ipod|android|nokia|sonyericsson|blackberry|samsung|sec\-|windows ce|motorola|mot\-|up.b|midp\-)", RegexOptions.IgnoreCase | RegexOptions.Multiline); if (Request.Browser.IsMobileDevice) { return true; } if (!string.IsNullOrEmpty(Request.UserAgent) && RegexMobile.IsMatch(Request.UserAgent)) { return true; } return false; }