[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.
Assembly: System.IO (in System.IO.dll)
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.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.