Step 1. Add following namespace
  1. using System.IO;
Step 2. We can use File.Copy method to copy a file from current location to a new location. We can also change the file name as well. The following code snippet reads all files in Your Path folder.
Note: Replace "Your Path" with the full path of your directory you want to move and "Your Destination" with your new full path.
  1. public void readfiles()
  2. {
  3. string[] filePaths = Directory.GetFiles("Your Path");
  4. foreach (var filename in filePaths)
  5. {
  6. string file = filename.ToString();
  7. //Do your job with "file"
  8. string str = "Your Destination"+file.ToString(),Replace("Your Path");
  9. if (!File.Exists(str))
  10. {
  11. File.Copy(file , str);
  12. }
  13. }
  14. }
Here is a detailed tutorial on file class, Working with Files Using File Class In C#