- using System;
- using System.ServiceProcess;
- static class Program
- {
- static void Main()
- {
- if (Environment.UserInteractive)
- {
- // Running as a console app
- service.OnStart(null);
- Console.WriteLine("Press any key to stop the service...");
- Console.ReadKey();
- service.OnStop();
- }
- else
- {
- // Running as a Windows service
- ServiceBase[] ServicesToRun;
- {
- };
- ServiceBase.Run(ServicesToRun);
- }
- }
- }
Recent Pastes