반응형
public static void CopyFilesRecursively(string sourcePath, string targetPath)
{
//Now Create all of the directories
foreach (string dirPath in Directory.GetDirectories(sourcePath, "*", SearchOption.AllDirectories))
{
Directory.CreateDirectory(dirPath.Replace(sourcePath, targetPath));
}
//Copy all the files & Replaces any files with the same name
foreach (string newPath in Directory.GetFiles(sourcePath, "*.*", SearchOption.AllDirectories))
{
File.Copy(newPath, newPath.Replace(sourcePath, targetPath), true);
}
}
반응형
'[====== Development ======] > C#' 카테고리의 다른 글
[WPF] Image 더블클릭 Command Binding (0) | 2022.02.28 |
---|---|
[WPF] Style 코드에서 binding reference 에러 발생시 (0) | 2022.02.24 |
C# List Custom Comparison (0) | 2022.02.16 |
WPF 콘트롤의 부모컴포넌트부터의 자표값 구하는법 (0) | 2022.02.15 |
WPF에서 PDF file 출력 (0) | 2022.01.14 |