Exemple #1
0
 private void Time_Elapsed(object sender, ElapsedEventArgs e)
 {
     try
     {
         //这里是监测操作
         new ImgsDetectionHelper().Monitor();
     }
     catch (Exception ex)
     {
         ErrorCollectHelper.ErrorLog(ex.ToString());
     }
 }
Exemple #2
0
        public MonitoringService()
        {
            InitializeComponent();
            int timelast = 0;

            if (int.TryParse(timelagStr, out timelast))
            {
                if (timelast > 1)
                {
                    time = new Timer(timelast * 60 * 60);
                }
                else
                {
                    time = new Timer(timelag);
                    ErrorCollectHelper.ErrorLog("配置文件错误!timelag配置不符合条件,采取默认1小时内置配置");
                }
            }
            else
            {
                time = new Timer(timelag);
                ErrorCollectHelper.ErrorLog("配置文件错误!timelag配置不符合条件,采取默认1小时内置配置");
            }
        }