StorageFile.MoveAsync Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
MoveAsync(IStorageFolder) |
Moves the current file to the specified folder. |
MoveAsync(IStorageFolder, String) |
Moves the current file to the specified folder and renames the file according to the desired name. |
MoveAsync(IStorageFolder, String, NameCollisionOption) |
Moves the current file to the specified folder and renames the file according to the desired name. This method also specifies what to do if a file with the same name already exists in the specified folder. |
Moves the current file to the specified folder.
public:
virtual IAsyncAction ^ MoveAsync(IStorageFolder ^ destinationFolder) = MoveAsync;
/// [Windows.Foundation.Metadata.Overload("MoveOverloadDefaultNameAndOptions")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncAction MoveAsync(IStorageFolder const& destinationFolder);
[Windows.Foundation.Metadata.Overload("MoveOverloadDefaultNameAndOptions")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncAction MoveAsync(IStorageFolder destinationFolder);
function moveAsync(destinationFolder)
Public Function MoveAsync (destinationFolder As IStorageFolder) As IAsyncAction
Parameters
- destinationFolder
- IStorageFolder
The destination folder where the file is moved.
This destination folder must be a physical location. Otherwise, if the destination folder exists only in memory, like a file group, this method fails and throws a System.Exception with the following message: Value does not fall within the expected range.
Returns
No object or value is returned by this method.
Implements
- Attributes
See also
Applies to
WinRT Build 26100 and other versions
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |
Moves the current file to the specified folder and renames the file according to the desired name.
public:
virtual IAsyncAction ^ MoveAsync(IStorageFolder ^ destinationFolder, Platform::String ^ desiredNewName) = MoveAsync;
/// [Windows.Foundation.Metadata.Overload("MoveOverloadDefaultOptions")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncAction MoveAsync(IStorageFolder const& destinationFolder, winrt::hstring const& desiredNewName);
[Windows.Foundation.Metadata.Overload("MoveOverloadDefaultOptions")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncAction MoveAsync(IStorageFolder destinationFolder, string desiredNewName);
function moveAsync(destinationFolder, desiredNewName)
Public Function MoveAsync (destinationFolder As IStorageFolder, desiredNewName As String) As IAsyncAction
Parameters
- destinationFolder
- IStorageFolder
The destination folder where the file is moved.
This destination folder must be a physical location. Otherwise, if the destination folder exists only in memory, like a file group, this method fails and throws a System.Exception with the following message: Value does not fall within the expected range.
- desiredNewName
-
String
Platform::String
winrt::hstring
The desired name of the file after it is moved.
If there is an existing file in the destination folder that already has the specified desiredNewName, Windows generates a unique name for the file.
Returns
No object or value is returned by this method.
Implements
- Attributes
See also
Applies to
WinRT Build 26100 and other versions
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |
Moves the current file to the specified folder and renames the file according to the desired name. This method also specifies what to do if a file with the same name already exists in the specified folder.
public:
virtual IAsyncAction ^ MoveAsync(IStorageFolder ^ destinationFolder, Platform::String ^ desiredNewName, NameCollisionOption option) = MoveAsync;
/// [Windows.Foundation.Metadata.Overload("MoveOverload")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncAction MoveAsync(IStorageFolder const& destinationFolder, winrt::hstring const& desiredNewName, NameCollisionOption const& option);
[Windows.Foundation.Metadata.Overload("MoveOverload")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncAction MoveAsync(IStorageFolder destinationFolder, string desiredNewName, NameCollisionOption option);
function moveAsync(destinationFolder, desiredNewName, option)
Public Function MoveAsync (destinationFolder As IStorageFolder, desiredNewName As String, option As NameCollisionOption) As IAsyncAction
Parameters
- destinationFolder
- IStorageFolder
The destination folder where the file is moved.
This destination folder must be a physical location. Otherwise, if the destination folder exists only in memory, like a file group, this method fails and throws a System.Exception with the following message: Value does not fall within the expected range.
- desiredNewName
-
String
Platform::String
winrt::hstring
The desired name of the file after it is moved.
If there is an existing file in the destination folder that already has the specified desiredNewName, the specified NameCollisionOption determines how Windows responds to the conflict.
- option
- NameCollisionOption
An enum value that determines how Windows responds if the desiredNewName is the same as the name of an existing file in the destination folder.
Returns
No object or value is returned by this method.
Implements
- Attributes
See also
Applies to
WinRT Build 26100 and other versions
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |