Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.IO;
- using ClassLibrary1;
- namespace Fomin
- {
- class Program
- {
- static void Main(string[] args)
- {
- string folderName = @"...\...\...\";
- do {
- Console.WriteLine("Input Folder name");
- folderName += Console.ReadLine();
- try
- {
- DirectoryInfo di = new DirectoryInfo(folderName);
- var b = di.GetFiles("*.txt");
- OverAllResults ov = new OverAllResults(folderName);
- foreach (var f in b)
- {
- ov.add(f.ToString());
- }
- foreach (var result in ov.perRes)
- {
- Console.WriteLine(result.ToString());
- }
- }
- catch (DirectoryNotFoundException)
- {
- Console.WriteLine("Enter correct Directory");
- }
- catch (FileNotFoundException)
- {
- Console.WriteLine("Can not find file!");
- }
- catch (Exception) {
- }
- Console.WriteLine("Press ecs to exit");
- }
- while (Console.ReadKey().Key!=ConsoleKey.Escape);//exit from programm by ecs
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement