static void Main(string[] args) { Win32.RemoveMenu(Win32.GetSystemMenu(Win32.FindWindow(null, System.Console.Title), 0), 0xf060, Convert.ToInt32(false)); AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException; Server = new FrameworkServer(); Server.Start(); Cmd(); }
private static void Cmd() { var key = System.Console.ReadLine(); var cmds = key.ToLower().Split(' '); if (cmds.Length == 0) { return; } var cmd = cmds[0]; switch (cmd) { case "exit": Csl.Wl("正在关闭应用程序。。。等待最后一个心跳执行完成。。。"); Server.Close(); Csl.Wl("2秒后关闭应用程序。。。"); Thread.Sleep(2000); Process.GetCurrentProcess().CloseMainWindow(); break; case "start": Server.Start(); Cmd(); break; case "gc": { Stopwatch sw = new Stopwatch(); sw.Start(); GC.Collect(); sw.Stop(); Cmd(); break; } default: { Server.Cmd(cmd); Cmd(); break; } return; } }
protected override void OnStart(string[] args) { _server = new FrameworkServer(); _server.Start(); }