Пример #1
0
        private static void ProcessDirectory(string directoryPath, string fileType)
        {
            //  var allFiles = Directory.GetFiles(directoryPath);// to get all files

            switch (fileType)
            {
            case "TEXT":
                string[] textFiles = Directory.GetFiles(directoryPath, "*.txt");
                foreach (var textFilePath in textFiles)
                {
                    var fileProcessor = new FileProcessor(textFilePath);
                    fileProcessor.Process();
                }
                break;

            default:
                Console.WriteLine($"Error");
                break;
            }
        }
Пример #2
0
        private static void ProcessSingleFile(string filePath)
        {
            var fileProcessor = new FileProcessor(filePath);

            fileProcessor.Process();
        }