C#
Parameters
- sourceDirName
- The path of the file or directory to move.
- destDirName
- The path to the new location for sourceDirName. If sourceDirName is a file, then destDirName must also be a file name.
Exception | Description |
---|---|
System.IO.IOException | An attempt was made to move a directory to a different volume. -or- destDirName already exists. -or- The sourceDirName and destDirName parameters refer to the same file or directory. -or- The directory or a file within it is being used by another process. |
System.UnauthorizedAccessException | The caller does not have the required permission. |
System.ArgumentException | sourceDirName or destDirName is a zero-length string, contains only white space, or contains one or more invalid characters. |
System.ArgumentNullException | sourceDirName or
destDirName is null . |
System.IO.DirectoryNotFoundException | The specified path is not found or invalid (for example, it is on an unmapped drive). |
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2