Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Moves a specified file to a new ___location, providing the option to specify a new file name.
Namespace: System.IO
Assembly: System.IO (in System.IO.dll)
Syntax
'Declaration
Public Shared Sub Move ( _
sourceFileName As String, _
destFileName As String _
)
public static void Move(
string sourceFileName,
string destFileName
)
public:
static void Move(
String^ sourceFileName,
String^ destFileName
)
static member Move :
sourceFileName:string *
destFileName:string -> unit
public static function Move(
sourceFileName : String,
destFileName : String
)
Parameters
- sourceFileName
Type: System. . :: . .String
The name of the file to move.
- destFileName
Type: System. . :: . .String
The new path for the file.
Remarks
This method works across disk volumes, and it does not throw an exception if the source and destination are the same. Note that if you attempt to replace a file by moving a file of the same name into that directory, you get an IOException. You cannot use the Move method to overwrite an existing file.
The sourceFileName and destFileName arguments are permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see GetCurrentDirectory.
If you try to move a file across disk volumes and that file is in use, the file is copied to the destination, but it is not deleted from the source.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.