예제 #1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            if ((1 == args.Length) && ("-runAsApp".ToUpper() == args[0].ToUpper()))
            {
                Main m = new Main();
                m.Config();
                Console.WriteLine("Modules loaded and configured...");
                m.RunModules();
                Console.WriteLine("Run modules...");
                Console.WriteLine("Press any key for exit...");
                Console.ReadKey();
            }
            else
            {

                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[]
            {
                new NService()
            };

                ServiceBase.Run(ServicesToRun);
            }
        }
예제 #2
0
 public NService()
 {
     InitializeComponent();
     _service = new Main();
 }