public AsyncServer() { Instance = this; Thread thread1 = new Thread(ThreadFunc); thread1.Start(); AsyncServer.Instance.SetProgress("Idle", 0); working = true; }
static void Main(string[] args) { ConsoleWindow.QuickEditMode(false); AsyncServer server = new AsyncServer(); if (args.Length == 0) { args = new string[1]; args[0] = "cmdline"; } if (args[0] == "compile-time") { CompileTime(args); } else if (args[0] == "compile-time-cs") { CompileTimeCS(args); } else if (args[0] == "download-recent") { DownloadRecent(args); } else if (args[0] == "download-file") { DownloadRecent(args); } else if (args[0] == "upgrade") { Upgrade(""); } else if (args[0] == "cmdline") { bool quit = false; do { Console.WriteLine("\nDDR版本更新工具v1.0"); Console.WriteLine("\n----------------------------------------------------------------------------------------------------------------------"); Console.WriteLine("----------------------------------------------------------------------------------------------------------------------"); Console.WriteLine("请输入指令:"); Console.WriteLine(" v 显示当前版本 最新版本及可升级版本"); Console.WriteLine(" u [ver] 升级到版本ver ver为空则升级到最新版本"); Console.WriteLine(" b 查看工具版本"); Console.WriteLine(" quit 退出"); string cmd = Console.ReadLine(); if (cmd == "quit") { quit = true; } else if (cmd.StartsWith("v")) { ShowVersion(); } else if (cmd.StartsWith("u")) { List <string> cmdargs = cmd.Split(' ').ToList(); if (cmdargs.Count < 2) { cmdargs.Add(""); } Upgrade(cmdargs[1]); } else if (cmd.StartsWith("b")) { Console.Write("\n当前工具版本:" + Version.BuildTime); } else if (cmd.StartsWith("t")) { } } while (!quit); } }