/******************************************************************************* * iNethinkCMS - 网站内容管理系统 * Copyright (C) 2012-2013 inethink.com * * @author jackyang <69991000@qq.com> * @website http://cms.inethink.com * @version 1.3.6.0 (2013-08-14) * * This is licensed under the GNU LGPL, version 3.0 or later. * For details, see: http://www.gnu.org/licenses/gpl-3.0.html *******************************************************************************/ using System; using System.Collections.Generic; using System.Text; namespace iNethinkCMS.Web.UI { public class BasePage : System.Web.UI.Page { public Model.Model_Config siteConfig = new Model.Model_Config(); protected Model.Model_Config seoConfig = new Model.Model_Config(); override protected void OnInit(EventArgs e) { //Server.ScriptTimeout = 90; //默认脚本过期时间 siteConfig = new BLL.BLL_Config().GetModel_SysConfig(); //获取站点配置信息 seoConfig = new BLL.BLL_Config().GetModel_SeoConfig(); //获取SEO配置信息 base.OnInit(e); } #region 对用户访问进行判断 如果是手机的话返回true,否则返回false protected string[] Keywords = { "Noki","Eric", "WapI", "MC21", "AUR", "R380","UP.B","WinW", "UPG1","upsi","QWAP","Jigs", "Java","Alca","MITS","MOT-", "My S","WAPJ","fetc","ALAV", "Wapa","UCWEB","BlackBerry", "J2ME","Oper","Android","mozilla", "NetFront","UCWEB","iPhone","Windows CE", "MIDP-2.0","Android","Opera Mini", "SymbianOS","Windows Phone","iPad" }; protected bool isMobile() { string agent = Request.Headers["User-Agent"]; return isMobile(agent); } protected bool isMobile(String userAgent) { foreach (string keyword in Keywords) { if (userAgent.IndexOf(keyword) > -1) { return true; } } return false; } #endregion } }