Example #1
0
 /// <summary>
 /// Der Haupteinstiegspunkt für die Anwendung.
 /// </summary>
 static void Main(string[] args)
 {
     if (!Environment.UserInteractive)
     {
         var ServicesToRun = new ServiceBase[]
         {
             new BarcodeScannerService()
         };
         ServiceBase.Run(ServicesToRun);
     }
     else
     {
         try
         {
             EnableConsole();
             var service = new BarcodeScannerService();
             service.StartForeground(args);
         }
         catch (Exception exc)
         {
             Console.WriteLine(exc.Message);
             var innerExc = exc.InnerException;
             while (innerExc != null)
             {
                 Console.WriteLine(innerExc.Message);
                 innerExc = innerExc.InnerException;
             }
         }
     }
 }
Example #2
0
 /// <summary>
 /// Der Haupteinstiegspunkt für die Anwendung.
 /// </summary>
 static void Main(string[] args)
 {
    if (!Environment.UserInteractive)
    {
       var ServicesToRun = new ServiceBase[]
                                        {
                                           new BarcodeScannerService()
                                        };
       ServiceBase.Run(ServicesToRun);
    }
    else
    {
       try
       {
          EnableConsole();
          var service = new BarcodeScannerService();
          service.StartForeground(args);
       }
       catch (Exception exc)
       {
          Console.WriteLine(exc.Message);
          var innerExc = exc.InnerException;
          while (innerExc != null)
          {
             Console.WriteLine(innerExc.Message);
             innerExc = innerExc.InnerException;
          }
       }
    }
 }