StorageFolder.RenameAsync StorageFolder.RenameAsync StorageFolder.RenameAsync StorageFolder.RenameAsync StorageFolder.RenameAsync Method

Definition

Overloads

RenameAsync(String) RenameAsync(String) RenameAsync(String) RenameAsync(String) RenameAsync(String)

Renames the current folder.

RenameAsync(String, NameCollisionOption) RenameAsync(String, NameCollisionOption) RenameAsync(String, NameCollisionOption) RenameAsync(String, NameCollisionOption) RenameAsync(String, NameCollisionOption)

Renames the current folder and specifies what to do if a folder with the same name already exists.

RenameAsync(String) RenameAsync(String) RenameAsync(String) RenameAsync(String) RenameAsync(String)

Renames the current folder.

public : IAsyncAction RenameAsync(Platform::String desiredName)
IAsyncAction RenameAsync(winrt::hstring desiredName) const;
public IAsyncAction RenameAsync(String desiredName)
Public Function RenameAsync(desiredName As String) As IAsyncAction
Windows.Storage.StorageFolder.renameAsync(desiredName).done( /* Your success and error handlers */ );
Parameters
desiredName
String String String

The desired, new name for the current folder.

Returns

No object or value is returned by this method when it completes.

Remarks

If the name you specify is invalid, this method (and its overload) throws an exception. To handle all the ways the specified name could be invalid, you must catch all four of these exceptions:

E_INVALIDARG
E_FAIL
ERROR_FILENAME_EXCED_RANGE
ERROR_INVALID_NAME

If the file is deleted before the rename finishes, this method throws the ERROR_FILE_NOT_FOUND exception. You must also catch and handle this exception when you use this method.

See Also

RenameAsync(String, NameCollisionOption) RenameAsync(String, NameCollisionOption) RenameAsync(String, NameCollisionOption) RenameAsync(String, NameCollisionOption) RenameAsync(String, NameCollisionOption)

Renames the current folder and specifies what to do if a folder with the same name already exists.

public : IAsyncAction RenameAsync(Platform::String desiredName, NameCollisionOption option)
IAsyncAction RenameAsync(winrt::hstring desiredName, NameCollisionOption option) const;
public IAsyncAction RenameAsync(String desiredName, NameCollisionOption option)
Public Function RenameAsync(desiredName As String, option As NameCollisionOption) As IAsyncAction
Windows.Storage.StorageFolder.renameAsync(desiredName, option).done( /* Your success and error handlers */ );
Parameters
desiredName
String String String

The desired, new name for the current folder.

If there is an existing item in the current folder's location that already has the specified desiredName, the specified NameCollisionOption determines how Windows responds to the conflict.

option
NameCollisionOption NameCollisionOption NameCollisionOption

The enum value that determines how Windows responds if the desiredName is the same as the name of an existing item in the current folder's location.

Returns

No object or value is returned by this method when it completes.

See Also