예제 #1
0
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        static void Main()
        {
            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();
                }
            }
        }
예제 #2
0
 /// <summary>
 /// 应用程序的主入口点。
 /// </summary>
 static void Main()
 {
     if (!Environment.UserInteractive)
     {
         ServiceBase.Run(new Service1());
     }
     else
     {
         Bootstrap.Initialize();
         Bootstrap.Start();
         Console.WriteLine("Press enter to exit...");
         Console.ReadLine();
     }
 }
예제 #3
0
        static void Main()
        {
            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();
            }
        }
예제 #4
0
 public Service1()
 {
     InitializeComponent();
     Bootstrap.Initialize();
 }