Moves a specified file to a new location and potentially a new file name. This method does work across volumes.
[Visual Basic] Public Shared Sub Move( _ ByVal sourceFileName As String, _ ByVal destFileName As String _ ) [C#] public static void Move( string sourceFileName, string destFileName ); [C++] public: static void Move( String* sourceFileName, String* destFileName ); [JScript] public static function Move( sourceFileName : String, destFileName : String );
Exception Type | Condition |
---|---|
IOException | An I/O error occurs or the destination file already exists. |
ArgumentNullException | sourceFileName or destFileName is a null reference (in Visual Basic Nothing). |
ArgumentException | sourceFileName or destFileName is an empty string ("") or contains only whitespaces. |
SecurityException | The caller does not have the required permission. |
NGWS Runtime Security:
FileIOPermissionAccess | Read and write permission to the path. |