| GDStorageFileCopyAsync Method (IGDStorageFolder, String) |
Creates a copy of the file in the specified folder and renames the copy.
Namespace:
GD
Assembly:
GD (in GD.dll) Version: 255.255.255.255
Syntax public IAsyncOperation<GDStorageFile> CopyAsync(
IGDStorageFolder destinationFolder,
string desiredNewName
)
public:
virtual IAsyncOperation<GDStorageFile^>^ CopyAsync(
[InAttribute] IGDStorageFolder^ destinationFolder,
[InAttribute] String^ desiredNewName
) sealed
function CopyAsync(destinationFolder, desiredNewName);
Parameters
- destinationFolder
- Type: GDIGDStorageFolder
The destination folder where the copy is created. - desiredNewName
- Type: SystemString
The new name for the copy of the file created in the destinationFolder.
Return Value
Type:
IAsyncOperationGDStorageFileWhen this method completes, it returns a GDStorageFile that represents the copy of the file created in the destinationFolder.
Implements
IGDStorageFileCopyAsync(IGDStorageFolder, String)Exceptions Exception | Condition |
---|
AccessDeniedException | (C# equivalent: System.UnauthorizedAccessException) Secure storage was remotely wiped. |
Exception |
Name you specify is invalid. To handle all the ways the specified name could be invalid, you must catch all of these exceptions:
E_FAIL | ERROR_INVALID_NAME | ERROR_ALREADY_EXISTS | ERROR_INVALID_PARAMETER |
|
Remarks Examples
The following example shows how to get the folder that has the specified absolute path in the SDK secure storage.
using GD;
GDStorageFolder secureFolder = GDWindows.Instance.SecureFolder;
GDStorageFolder folder = await secureFolder.GetFolderAsync("folder");
GDStorageFile newFile = await secureFolder.CreateFileAsync("test.txt");
GDStorageFile copiedFile = await newFile.CopyAsync(folder);
See Also