Saturday, July 17, 2010

Move File / Folder

To move a file or a folder using C# we need the function Move() of the classes System.IO.File or System.IO.Directory:


In both variants the first parameter represents the path to the sourcefile / sourcefolder, the second to the targetfile / targetfolder.
The path has to be valid, otherwise the function throws an exception.

No comments:

Post a Comment