Ejemplo n.º 1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main()
 {
     #if DEBUG
     var service = new StandAlone();
     service.Start();
     MessageBox.Show("Press 'OK' to stop the service", "Service Debug Mode", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     service.Stop();
     MessageBox.Show("Service Stopped", "Service Debug Mode", MessageBoxButtons.OK, MessageBoxIcon.Information);
     #else
     ServiceBase[] ServicesToRun;
     ServicesToRun = new ServiceBase[]
     {
         new Service1()
     };
     ServiceBase.Run(ServicesToRun);
     #endif
 }
Ejemplo n.º 2
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
#if DEBUG
            var service = new StandAlone();
            service.Start();
            MessageBox.Show("Press 'OK' to stop the service", "Service Debug Mode", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            service.Stop();
            MessageBox.Show("Service Stopped", "Service Debug Mode", MessageBoxButtons.OK, MessageBoxIcon.Information);
#else
            ServiceBase[] ServicesToRun;
            ServicesToRun = new ServiceBase[]
            {
                new Service1()
            };
            ServiceBase.Run(ServicesToRun);
#endif
        }