Show a Copying-files dialog/form while manually copying files in C#?
There is one built in from the Microsoft.VisualBasic.FileIO Namespace. Don't let the name scare you, it is a very underrated namespace for C#. The static class FileSystem
has a CopyFile
and CopyDirectory
method that has that capability.
FileSystem Members
Pay Close attention to the UIOption
in both the CopyFile
and CopyDirectory
methods. This emulates displays the Windows Explorer copy window.
FileSystem.CopyFile(sourceFile, destinationFile, UIOption.AllDialogs);
FileSystem.CopyDirectory(sourceDirectory, destinationDirectory, UIOption.AllDialogs);