static void Main(string[] args) { if (args?.Length == 0) { args = new string[] { "StartHmiPro", "update-app", "clear-task" }; } var(s, d) = YUtil.CreateDynamic(); s.hello = "world"; Console.WriteLine(d["hello"]); var cmd = new Cmd(); cmd.Action = args[0]; cmd.Args = new { IsForced = true }; var hmis = loadHmi(YUtil.GetAbsolutePath(".\\Global.xls"), "Ip配置"); int asylumPort = 9988; int hmiPort = 8899; foreach (var pair in hmis) { string ip = pair.Value; var name = pair.Key; var hmiProUrl = $"http://{ip}:{hmiPort}"; var asylumUrl = $"http://{ip}:{asylumPort}"; var url = asylumUrl; SendToAsylum(url, cmd, name); //var url = hmiProUrl; //SendToHmiPro(url, args[2], name); } YUtil.ExitWithQ(); }
/// <summary> /// 程序入口 /// </summary> /// <param name="args"></param> public static void Main(string[] args) { Console.WriteAscii("Asylum"); parseStartupArgs(args); Logger.Info("启动中..."); var task = Init(); Task.WaitAll(new Task[] { task }); //启动失败 if (!task.Result) { Logger.Error("启动失败"); return; } YUtil.ExitWithQ(); }