Example #1
0
        public void FolderFilesInformation(string sourceFolder)
        {
            FileCopier fileCopier = new FileCopier();

            Parallel.ForEach(Directory.EnumerateFiles(sourceFolder), (currentFile) =>
            {
                string fileName = Path.GetFileName(currentFile);
                Console.WriteLine($"Found file {fileName}..");
                Console.WriteLine($"File {fileName} having SHA value {ComputeSHA(fileName)}");
            });;
        }
Example #2
0
        static void Main(string[] args)
        {
            Targeter   target = new Targeter();
            FileCopier copier = new FileCopier();

            Console.WriteLine("Give target folder..");
            string sourceFolder = Console.ReadLine();

            Console.WriteLine("Give destination folder..");
            string destinationFolder = Console.ReadLine();
            //"C:\Users\Razvan\source\repos\TaskHomework\TaskHomework\Folder1"
            //"C:\Users\Razvan\source\repos\TaskHomework\TaskHomework\Folder2"
            Task copy = copier.ProcessWriteAsync(sourceFolder, destinationFolder);

            Task.Run(() => copy);
            Task.WaitAll();
        }