Пример #1
0
 /// <summary>
 /// The Main Thread: This is where your Service is Run.
 /// </summary>
 static void Main(string[] args)
 {
     if (args.Length > 0 && args[0] == "--console")
     {
         var imageComparerService = new ImageComparerService();
         imageComparerService.OnStart(args.Skip(1).ToArray());
         imageComparerService.listenerThread.Join();
         imageComparerService.OnStop();
     }
     else if (args.Length > 0 && args[0] == "--install")
     {
         ManagedInstallerClass.InstallHelper(new[] { Assembly.GetExecutingAssembly().Location });
     }
     else if (args.Length > 0 && args[0] == "--uninstall")
     {
         ManagedInstallerClass.InstallHelper(new[] { "/u", Assembly.GetExecutingAssembly().Location });
     }
     else
     {
         ServiceBase.Run(new ImageComparerService());
     }
 }
Пример #2
0
 /// <summary>
 /// The Main Thread: This is where your Service is Run.
 /// </summary>
 static void Main(string[] args)
 {
     if (args.Length > 0 && args[0] == "--console")
     {
         var imageComparerService = new ImageComparerService();
         imageComparerService.OnStart(args.Skip(1).ToArray());
         imageComparerService.listenerThread.Join();
         imageComparerService.OnStop();
     }
     else if (args.Length > 0 && args[0] == "--install")
     {
         ManagedInstallerClass.InstallHelper(new[] { Assembly.GetExecutingAssembly().Location });
     }
     else if (args.Length > 0 && args[0] == "--uninstall")
     {
         ManagedInstallerClass.InstallHelper(new[] { "/u", Assembly.GetExecutingAssembly().Location });
     }
     else
     {
         ServiceBase.Run(new ImageComparerService());
     }
 }