/// <exception cref="System.IO.IOException"></exception> public static void CopyFolder(FilePath src, FilePath dest) { if (src.IsDirectory()) { //if directory not exists, create it if (!dest.Exists()) { dest.Mkdir(); } //list all the directory contents string[] files = src.List(); foreach (string file in files) { //construct the src and dest file structure FilePath srcFile = new FilePath(src, file); FilePath destFile = new FilePath(dest, file); //recursive copy CopyFolder(srcFile, destFile); } } else { CopyFile(src, dest); } }