예제 #1
0
 static TaoBaoPluginProvider()
 {
     try
     {
         _sp = (TaoBaoPluginBase)Activator.CreateInstance(Type.GetType("SAS.Taobao.TaoBaoPlugin, SAS.Taobao", false, true));
     }
     catch
     {
         _sp = null;
     }
 }
예제 #2
0
        /// <summary>
        /// BasePage类构造函数
        /// </summary>
        public TaoBaoPage()
        {
            config = GeneralConfigs.GetConfig();
            taobaoconfig = TaoBaoConfigs.GetConfig();
            if (TaoBaoPluginProvider.GetInstance() != null)
            {
                tpb = TaoBaoPluginProvider.GetInstance();
            }
            //if (MallPluginProvider.GetInstance() == null)
            //    config.Enablemall = 0;
            userid = Utils.StrToInt(LogicUtils.GetCookie("userid"), -1);

            // 如果启用游客页面缓存,则对游客输出缓存页
            if (userid == -1 && config.Guestcachepagetimeout > 0 && GetUserCachePage(pagename))
                return;

            if (config.Nocacheheaders == 1)
            {
                System.Web.HttpContext.Current.Response.BufferOutput = false;
                System.Web.HttpContext.Current.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
                System.Web.HttpContext.Current.Response.Cache.SetExpires(DateTime.Now.AddDays(-1));
                System.Web.HttpContext.Current.Response.Expires = 0;
                System.Web.HttpContext.Current.Response.CacheControl = "no-cache";
                System.Web.HttpContext.Current.Response.Cache.SetNoStore();
            }

            pmsound = Utils.StrToInt(LogicUtils.GetCookie("pmsound"), 0);

            mainnavigation = Navs.GetNavigationString(userid, useradminid);
            subnavigation = Navs.GetSubNavigation();
            mainnavigationhassub = Navs.GetMainNavigationHasSub();

            //校验用户是否可以访问站点
            if (!ValidateUserPermission())
                return;

            //更新用户在线时长
            if (userid != -1)
                OnlineUsers.UpdateOnlineTime(config.Oltimespan, userid);

            nowdate = Utils.GetDate();
            nowtime = Utils.GetTime();
            nowdatetime = Utils.GetDateTime();
            ispost = SASRequest.IsPost();
            isget = SASRequest.IsGet();
            link = "";
            script = "";

            isseccode = Utils.InArray(pagename, config.Seccodestatus);

            //校验验证码
            if (isseccode && ispost && !ValidateVerifyCode())
                return;

            //newtopicminute = config.Viewnewtopicminute;
            m_starttick = DateTime.Now;

            ShowPage();

            m_processtime = DateTime.Now.Subtract(m_starttick).TotalMilliseconds / 1000;
        }