Ejemplo n.º 1
0
 /// <summary>
 ///   The main entry point for the application.
 /// </summary>
 /// <param name="args">The args.</param>
 private static void Main(string[] args)
 {
     if ((args.Length > 0) && (Array.IndexOf(args, "/console") != -1))
     {
         var service = new Service();
         service.run_as_console(args);
     } else
     {
         Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
         var servicesToRun = new ServiceBase[] { new Service() };
         ServiceBase.Run(servicesToRun);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 ///   The main entry point for the application.
 /// </summary>
 /// <param name="args">The args.</param>
 private static void Main(string[] args)
 {
     if ((args.Length > 0) && (Array.IndexOf(args, "/console") != -1))
     {
         var service = new Service();
         service.run_as_console(args);
     }
     else
     {
         Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
         var servicesToRun = new ServiceBase[] { new Service() };
         ServiceBase.Run(servicesToRun);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        ///   The main entry point for the application.
        /// </summary>
        /// <param name="args">The args.</param>
        private static void Main(string[] args)
        {
            // Ensure that the correct Security Protocol is being used.  Do this as early
            // as possible, rather than having to do it in multiple places in the code
            // base.
            // Use TLS1.2, TLS1.1, TLS1.0, SSLv3
            SecurityProtocol.set_protocol();

            if ((args.Length > 0) && (Array.IndexOf(args, "/console") != -1))
            {
                var service = new Service();
                service.run_as_console(args);
            }
            else
            {
                Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
                var servicesToRun = new ServiceBase[] { new Service() };
                ServiceBase.Run(servicesToRun);
            }
        }