示例#1
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);
            }
        }
示例#2
0
文件: Program.cs 项目: na2sia/CP4
 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);
     }
 }
示例#3
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);
            }
        }