Exemplo n.º 1
0
        static void Main()
        {
            var services = new ServiceBase[] { new Service() };

#if DEBUG
            var fileMover = new FileMover(services[0].EventLog);
            fileMover.Start();
            System.Console.WriteLine("Service started...");
            System.Console.WriteLine("Press ENTER to stop service");
            System.Console.ReadLine();
            fileMover.Stop();
#else
            ServiceBase.Run(services);
#endif
        }
Exemplo n.º 2
0
 protected override void OnStart(string[] args)
 {
     fileMover.Start();
     ExitCode = fileMover.ExitCode;
 }