此代码是为了解决手机 .net代码
static public ListMobileNames = new List { iphone, android, mobile, ucweb, opera mini, samsung, htc, lg, sonyericsson, nokia, mot, blackberry, j2me }; protected void Page_Load(object sender, EventArgs e) { String clientType = HttpContext.Current.Request.UserAgent.ToLower(); Boolean isPCBrowser = true; foreach (String mobile in MobileNames) { if (clientType.Contains(mobile)) { isPCBrowser = false; break; } } pnlHeader.Visible = isPCBrowser; }