-api-id | -api-type |
---|---|
M:Windows.Storage.StorageFile.CopyAsync(Windows.Storage.IStorageFolder,System.String,Windows.Storage.NameCollisionOption) |
winrt method |
Creates a copy of the file in the specified folder and renames the copy. This method also specifies what to do if a file with the same name already exists in the destination folder.
The destination folder where the copy of the file is created.
The new name for the copy of the file created in the destinationFolder.
One of the enumeration values that determines how to handle the collision if a file with the specified desiredNewName already exists in the destination folder.
When this method completes, it returns a StorageFile that represents the copy of the file created in the destinationFolder.
Note
When StorageFile.CopyAsync is used to copy a file that is encrypted to a destination that is not encrypted, the call will fail with the following exception: System.UnauthorizedAccessException: Access is denied. (Excep_FromHResult 0x80070005)
You don't have permission to copy a file into the destination folder.
CopyAsync(IStorageFolder), CopyAsync(IStorageFolder, String)