Пример #1
0
        static void Main(string[] args)
        {
            if(args.Length < 1)
            {
                Console.WriteLine("Missing file or folder path: \nUsage: batchFileProcessor filepath(folderpath)");
                return;
            }

            FileAccessLogic accessor = new FileAccessLogic();
            accessor.OnNotify += testNotify;
            accessor.OnProcess += findTotalFilesLength;

            accessor.Recursive = true;
            accessor.Execute(args[0]);

            Console.WriteLine("Total Files length in directory {0} is {1}", args[0], totalFilesLen);
            // Keep the console window open in debug mode.
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            if(args.Length < 1)
            {
                Console.WriteLine("Missing file or folder path: \nUsage: batchFileProcessor filepath(folderpath)");
                return;
            }

            // This is another comment
            // This is another comment
            FileAccessLogic accessor = new FileAccessLogic();
            accessor.FilePattern = "*.txt";
            accessor.OnProcess += ProcessFile;

            accessor.Recursive = true;
            accessor.Execute(args[0]);

            Console.WriteLine("{0} *.txt files in directory \"{1}\" with total size {2} bytes and average size {3} bytes", fileCount, args[0], totalFilesLen, (float)totalFilesLen / fileCount);
            // Keep the console window open in debug mode.
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }