Moves a given file to a new location and potentially a new file name. This method works across volumes.
[Visual Basic] Public Sub MoveTo( _ ByVal destFileName As String _ ) [C#] public void MoveTo( string destFileName ); [C++] public: void MoveTo( String* destFileName ); [JScript] public function MoveTo( destFileName : String );
Exception Type | Condition |
---|---|
ArgumentNullException | destFileName is a null reference (in Visual Basic Nothing). |
ArgumentException | destFileName is an empty string ("") or contains only whitespaces. |
IOException | An error occurs or the destination file already exists. |
SecurityException | The caller does not have the required permission. |
NGWS Runtime Security:
FileIOPermissionAccess | Read permission for the current File object. |
FileIOPermissionAccess | Write permission for the current File object and destination file. |