コード例 #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);
     }
 }