Пример #1
0
 public static void CopyFolder(string sourceFolder, string destFolder)
 {
     if (!Directory.Exists(destFolder))
     {
         Directory.CreateDirectory(destFolder);
     }
     foreach (string file in Directory.GetFiles(sourceFolder))
     {
         string fileName     = Path.GetFileName(file);
         string destFileName = Path.Combine(destFolder, fileName);
         int    num          = 1;
         System.IO.File.Copy(file, destFileName, num != 0);
     }
     foreach (string directory in Directory.GetDirectories(sourceFolder))
     {
         string fileName    = Path.GetFileName(directory);
         string destFolder1 = Path.Combine(destFolder, fileName);
         CUtils.CopyFolder(directory, destFolder1);
     }
 }