예제 #1
0
 /// <summary>
 /// 定时检查,并执行方法
 /// </summary>
 /// <param name="source"></param>
 /// <param name="e"></param>
 public void ChkSrv(object source, System.Timers.ElapsedEventArgs e)
 {
     try
     {
         System.Timers.Timer tt = (System.Timers.Timer)source;
         //可防止重复执行程序
         tt.Enabled = false;
         InlineRunner.RunAMSInline();
         tt.Enabled = true;
     }
     catch (Exception err)
     {
         LogHelper.ErrorLog(err);
     }
 }
예제 #2
0
        public static void Run(string[] args)
        {
            if (args.Length > 0)
            {
                DateTime from  = new DateTime();
                DateTime to    = new DateTime();
                bool     isYes = DateTime.TryParseExact(args[0], "yyyy-MM-dd-HH.mm.ss", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out from);

                if (args.Length == 1)
                {
                    to = DateTime.Now;
                }
                else if (args.Length == 2)
                {
                    isYes &= DateTime.TryParseExact(args[1], "yyyy-MM-dd-HH.mm.ss", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out to);
                }
                else
                {
                    Console.WriteLine("Usage:AMSInlineRunner from to[default now]");
                    return;
                }

                if (!isYes)
                {
                    Console.WriteLine("正确的时间格式:yyyy-MM-dd-HH.mm.ss");
                    return;
                }
                InlineDebugSetting.SetValue();
                InlineRunner.RunInlineTest(from, to, false);
            }
            else
            {
                InlineDebugSetting.SetValue();
                InlineRunner.RunInlineTest();
            }
            System.Threading.Thread.Sleep(500);
            Console.WriteLine("ok");
        }
예제 #3
0
 public static void Run()
 {
     InlineDebugSetting.SetValue();
     InlineRunner.RunAMSInline();
 }