Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
            }
        }