// 访问的方法
public static bool IsMobileVisit(string userAgent)
{
if (userAgent.IsNullOrEmpty()) return false;
Regex regMobileVisit = new Regex("mobile|mobi|nokia|samsung|sonyericsson|mot|blackberry|lg|htc|j2me|ucweb|opera mini",
RegexOptions.IgnoreCase | RegexOptions.Multiline);
return regMobileVisit.IsMatch(userAgent);
} if (MainModel.IsMobileVisit(Request.UserAgent))
return Redirect(手机网页的地址);