共用方式為


FileInformation.CopyAsync 方法

定義

多載

CopyAsync(IStorageFolder)

建立 StorageFile 的複本,並將它儲存在指定的 StorageFolder中。

CopyAsync(IStorageFolder, String)

建立 StorageFile的複本、提供指定的檔案名,並將它儲存在指定的 StorageFolder中。

CopyAsync(IStorageFolder, String, NameCollisionOption)

建立 StorageFile的複本、提供指定的檔案名,並將它儲存在指定的 StorageFolder中。 如果具有相同名稱的檔案已存在於指定的資料夾中,方法也會指定該怎麼做。

CopyAsync(IStorageFolder)

建立 StorageFile 的複本,並將它儲存在指定的 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)

參數

destinationFolder
IStorageFolder

要在其中儲存所複製檔案的資料夾。

傳回

當這個方法成功完成時,它會以 StorageFile 物件的形式傳回復本。

實作

屬性

另請參閱

適用於

CopyAsync(IStorageFolder, String)

建立 StorageFile的複本、提供指定的檔案名,並將它儲存在指定的 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)

參數

destinationFolder
IStorageFolder

要在其中儲存所複製檔案的資料夾。

desiredNewName
String

Platform::String

winrt::hstring

新複本的名稱。

傳回

當這個方法成功完成時,它會以 StorageFile 物件的形式傳回復本。

實作

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)
屬性

另請參閱

適用於

CopyAsync(IStorageFolder, String, NameCollisionOption)

建立 StorageFile的複本、提供指定的檔案名,並將它儲存在指定的 StorageFolder中。 如果具有相同名稱的檔案已存在於指定的資料夾中,方法也會指定該怎麼做。

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)

參數

destinationFolder
IStorageFolder

要在其中儲存所複製檔案的資料夾。

desiredNewName
String

Platform::String

winrt::hstring

新複本的名稱。

option
NameCollisionOption

值,指出如果檔案名已存在於目的地資料夾中,該怎麼辦。

傳回

當這個方法成功完成時,它會以 StorageFile 物件的形式傳回復本。

實作

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)
屬性

另請參閱

適用於