Exemplo n.º 1
0
 /// <summary>
 /// 实现接口的Init方法
 /// </summary>
 /// <param name="context"></param>
 public void Init(HttpApplication context)
 {
     OnlineUsers.ResetOnlineList();
     context.BeginRequest += new EventHandler(ReUrl_BeginRequest);
     if (eventTimer == null && ScheduleConfigs.GetConfig().Enabled)
     {
         EventLogs.LogFileName = Utils.GetMapPath(string.Format("{0}cache/scheduleeventfaildlog.config", BaseConfigs.GetForumPath));
         EventManager.RootPath = Utils.GetMapPath(BaseConfigs.GetForumPath);
         eventTimer            = new Timer(new TimerCallback(ScheduledEventWorkCallback), context.Context, 60000, EventManager.TimerMinutesInterval * 60000);
     }
     context.Error += new EventHandler(Application_OnError);
 }
Exemplo n.º 2
0
        /// <summary>
        /// 实现接口的Init方法
        /// </summary>
        /// <param name="context"></param>
        public void Init(HttpApplication context)
        {
            try
            {
                OnlineUsers.ResetOnlineList();
                context.BeginRequest += new EventHandler(ReUrl_BeginRequest);

                if (eventTimer == null && ScheduleConfigs.GetConfig().Enabled)
                {
                    EventManager.RootPath = AppDomain.CurrentDomain.BaseDirectory;
                    eventTimer            = new Timer(new TimerCallback(ScheduledEventWorkCallback), context.Context, 60000, EventManager.TimerMinutesInterval * 60000);
                }
            }
            catch (Exception e)
            {
                EventLogs.WriteFailedLog("Discuz.Forum.HttpModule Init:" + e.Message);
            }
        }