static void Main(string[] args) { if (!Environment.UserInteractive) { ServiceBase.Run(new Service1()); } else { Bootstrap.Initialize(); Bootstrap.Start(); Console.BackgroundColor = ConsoleColor.Black; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Initialize success..."); Console.ResetColor(); Console.WriteLine(); Console.WriteLine("Press enter to exit..."); var line = Console.ReadLine(); while (line != "exit") { switch (line) { case "cls": Console.Clear(); break; default: return; } line = Console.ReadLine(); } } }
static void Main(string[] args) { Bootstrap.Initialize(); Bootstrap.Start(); Console.WriteLine("Press enter to exit..."); var line = Console.ReadLine(); while (line != "exit") { switch (line) { case "cls": Console.Clear(); break; default: return; } line = Console.ReadLine(); } }
protected override void OnStart(string[] args) { Bootstrap.Start(); }