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