/// <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); } }
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"); }
public static void Run() { InlineDebugSetting.SetValue(); InlineRunner.RunAMSInline(); }