FileInformation.CopyAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
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)
- 属性