コード例 #1
0
ファイル: Program.cs プロジェクト: icprog/HmiPro
        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();
        }