Beispiel #1
0
 static void Main()
 {
     var service = new CSVFileWatcherService();
     service.Directory = @"D:\CSV\";
     service.FilesMask = "*.csv";
     if (Environment.UserInteractive)
     {
         AllocConsole();
         service.Start();
         Console.ReadKey();
         service.Stop();
     }
     else
     {
         ServiceBase.Run(service);
     }
 }
Beispiel #2
0
        static void Main()
        {
            var service = new CSVFileWatcherService();

            service.Directory = @"D:\CSV\";
            service.FilesMask = "*.csv";
            if (Environment.UserInteractive)
            {
                AllocConsole();
                service.Start();
                Console.ReadKey();
                service.Stop();
            }
            else
            {
                ServiceBase.Run(service);
            }
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            var service = new CSVFileWatcherService();

            service.Directory = @"C:\";
            service.FilesMask = "*.csv";
            if (Environment.UserInteractive)
            {
                AllocConsole();
                Console.CancelKeyPress += (x, y) => service.Stop();
                service.Start();
                Console.ReadKey();
                service.Stop();
            }
            else
            {
                ServiceBase.Run(service);
            }
        }