Udostępnij za pośrednictwem


FileInformation.CopyAsync Method

Definition

Overloads

CopyAsync(IStorageFolder)

Creates a copy of the StorageFile and stores it in the specified StorageFolder.

CopyAsync(IStorageFolder, String)

Creates a copy of the StorageFile, gives it the specified file name, and stores it in the specified StorageFolder.

CopyAsync(IStorageFolder, String, NameCollisionOption)

Creates a copy of the StorageFile, gives it the specified file name, and stores it in the specified StorageFolder. The method also specifies what to do if a file with the same name already exists in the specified folder.

CopyAsync(IStorageFolder)

Creates a copy of the StorageFile and stores it in the specified StorageFolder.

public:
 virtual IAsyncOperation<StorageFile ^> ^ CopyAsync(IStorageFolder ^ destinationFolder) = CopyAsync;
/// [Windows.Foundation.Metadata.Overload("CopyOverloadDefaultNameAndOptions")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<StorageFile> CopyAsync(IStorageFolder const& destinationFolder);
[Windows.Foundation.Metadata.Overload("CopyOverloadDefaultNameAndOptions")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StorageFile> CopyAsync(IStorageFolder destinationFolder);
function copyAsync(destinationFolder)
Public Function CopyAsync (destinationFolder As IStorageFolder) As IAsyncOperation(Of StorageFile)

Parameters

destinationFolder
IStorageFolder

The folder in which to store the copied file.

Returns

When this method completes successfully, it returns the copy as a StorageFile object.

Implements

Attributes

See also

Applies to

CopyAsync(IStorageFolder, String)

Creates a copy of the StorageFile, gives it the specified file name, and stores it in the specified StorageFolder.

public:
 virtual IAsyncOperation<StorageFile ^> ^ CopyAsync(IStorageFolder ^ destinationFolder, Platform::String ^ desiredNewName) = CopyAsync;
/// [Windows.Foundation.Metadata.Overload("CopyOverloadDefaultOptions")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<StorageFile> CopyAsync(IStorageFolder const& destinationFolder, winrt::hstring const& desiredNewName);
[Windows.Foundation.Metadata.Overload("CopyOverloadDefaultOptions")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StorageFile> CopyAsync(IStorageFolder destinationFolder, string desiredNewName);
function copyAsync(destinationFolder, desiredNewName)
Public Function CopyAsync (destinationFolder As IStorageFolder, desiredNewName As String) As IAsyncOperation(Of StorageFile)

Parameters

destinationFolder
IStorageFolder

The folder in which to store the copied file.

desiredNewName
String

Platform::String

winrt::hstring

The name of the new copy.

Returns

When this method completes successfully, it returns the copy as a StorageFile object.

Implements

M:Windows.Storage.IStorageFile.CopyAsync(Windows.Storage.IStorageFolder,System.String) M:Windows.Storage.IStorageFile.CopyAsync(Windows.Storage.IStorageFolder,Platform::String) M:Windows.Storage.IStorageFile.CopyAsync(Windows.Storage.IStorageFolder,winrt::hstring)
Attributes

See also

Applies to

CopyAsync(IStorageFolder, String, NameCollisionOption)

Creates a copy of the StorageFile, gives it the specified file name, and stores it in the specified StorageFolder. The method also specifies what to do if a file with the same name already exists in the specified folder.

public:
 virtual IAsyncOperation<StorageFile ^> ^ CopyAsync(IStorageFolder ^ destinationFolder, Platform::String ^ desiredNewName, NameCollisionOption option) = CopyAsync;
/// [Windows.Foundation.Metadata.Overload("CopyOverload")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<StorageFile> CopyAsync(IStorageFolder const& destinationFolder, winrt::hstring const& desiredNewName, NameCollisionOption const& option);
[Windows.Foundation.Metadata.Overload("CopyOverload")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StorageFile> CopyAsync(IStorageFolder destinationFolder, string desiredNewName, NameCollisionOption option);
function copyAsync(destinationFolder, desiredNewName, option)
Public Function CopyAsync (destinationFolder As IStorageFolder, desiredNewName As String, option As NameCollisionOption) As IAsyncOperation(Of StorageFile)

Parameters

destinationFolder
IStorageFolder

The folder in which to store the copied file.

desiredNewName
String

Platform::String

winrt::hstring

The name of the new copy.

option
NameCollisionOption

A value that indicates what to do if the file name already exists in the destination folder.

Returns

When this method completes successfully, it returns the copy as a StorageFile object.

Implements

M:Windows.Storage.IStorageFile.CopyAsync(Windows.Storage.IStorageFolder,System.String,Windows.Storage.NameCollisionOption) M:Windows.Storage.IStorageFile.CopyAsync(Windows.Storage.IStorageFolder,Platform::String,Windows.Storage.NameCollisionOption) M:Windows.Storage.IStorageFile.CopyAsync(Windows.Storage.IStorageFolder,winrt::hstring,Windows.Storage.NameCollisionOption)
Attributes

See also

Applies to