Advertisement
iiddaannyy

copy files

May 6th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication3
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             List<string> files = new List<string>();
  14.             string input = Console.ReadLine();
  15.             while (input != "-")
  16.             {
  17.                 files.Add(input);
  18.                 input = Console.ReadLine();
  19.             }
  20.             foreach (string file in files)
  21.             {
  22.                 string src = @"C:\Users\עידן\Desktop\תיקיה חדשה\IMG_" + file + ".JPG";
  23.                 string des = @"C:\Users\עידן\Desktop\תיקיה חדשה (2)\IMG_" + file + ".JPG";
  24.                 if (!System.IO.File.Exists(src))
  25.                 {
  26.                     Console.WriteLine("{0} could not be found.", src);
  27.                     continue;
  28.                 }
  29.                 System.IO.File.Copy(src, des, true);
  30.             }
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement