Beispiel #1
0
 static void Main()
 {
     if (!Environment.UserInteractive)//Windows服务
     {
         ServiceBase.Run(new Service1());
     }
     else//控制台启动
     {
         Bootstrap.Initialize();
         Bootstrap.Start();
         Console.WriteLine("Press Enter to exit...");
         Console.ReadLine();
     }
 }
Beispiel #2
0
 protected override void OnStart(string[] args)
 {
     // TODO: 在此处添加代码以启动服务。
     Bootstrap.Start();
 }