Hello,
part of the program which I'm working on should copy all files and folders from the selected path to the destination path (do a backup). And this the code being used:
It all works fine, but the problem is that my complete UI is unresponsive during the copy process. So my question is, how can I avoid that?
Thanks in advance!
part of the program which I'm working on should copy all files and folders from the selected path to the destination path (do a backup). And this the code being used:
C#:
foreach (string dirPath in Directory.GetDirectories(from_directory, "*", SearchOption.AllDirectories))
Directory.CreateDirectory(dirPath.Replace(from_directory, bkpdirectory));
foreach (string newPath in Directory.GetFiles(from_directory, "*.*", SearchOption.AllDirectories))
File.Copy(newPath, newPath.Replace(from_directory, bkpdirectory), true);
Thanks in advance!