CSharpUtils.FileUtils.CopyTree C# (CSharp) Method

CopyTree() public static method

public static CopyTree ( String SourcePath, String DestinationPath ) : void
SourcePath String
DestinationPath String
return void
		public static void CopyTree(String SourcePath, String DestinationPath)
		{
			// Now Create all of the directories
			foreach (string dirPath in Directory.GetDirectories(SourcePath, "*", SearchOption.AllDirectories))
			{
				Directory.CreateDirectory(dirPath.Replace(SourcePath, DestinationPath));
			}

            // Copy all the files
			foreach (string newPath in Directory.GetFiles(SourcePath, "*.*", SearchOption.AllDirectories))
			{
				File.Copy(newPath, newPath.Replace(SourcePath, DestinationPath));
			}
		}