-api-id | -api-type |
---|---|
M:Windows.Storage.IStorageItem.RenameAsync(System.String) |
winrt method |
Renames the current item.
The desired, new name of the item.
No object or value is returned by this method when it completes.
For this method and its overload, if the name you specify is invalid, this method 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.