Share via


FileInformation.RenameAsync 方法

定义

重载

RenameAsync(String)

重命名 StorageFile

RenameAsync(String, NameCollisionOption)

重命名 StorageFile,并指定在当前文件夹中已存在同名文件时要执行的操作。

RenameAsync(String)

重命名 StorageFile

public:
 virtual IAsyncAction ^ RenameAsync(Platform::String ^ desiredName) = RenameAsync;
/// [Windows.Foundation.Metadata.Overload("RenameAsyncOverloadDefaultOptions")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncAction RenameAsync(winrt::hstring const& desiredName);
[Windows.Foundation.Metadata.Overload("RenameAsyncOverloadDefaultOptions")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncAction RenameAsync(string desiredName);
function renameAsync(desiredName)
Public Function RenameAsync (desiredName As String) As IAsyncAction

参数

desiredName
String

Platform::String

winrt::hstring

新名称。

返回

此方法完成后,不会返回任何对象或值。

实现

M:Windows.Storage.IStorageItem.RenameAsync(System.String) M:Windows.Storage.IStorageItem.RenameAsync(Platform::String) M:Windows.Storage.IStorageItem.RenameAsync(winrt::hstring)
属性

另请参阅

适用于

RenameAsync(String, NameCollisionOption)

重命名 StorageFile,并指定在当前文件夹中已存在同名文件时要执行的操作。

public:
 virtual IAsyncAction ^ RenameAsync(Platform::String ^ desiredName, NameCollisionOption option) = RenameAsync;
/// [Windows.Foundation.Metadata.Overload("RenameAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncAction RenameAsync(winrt::hstring const& desiredName, NameCollisionOption const& option);
[Windows.Foundation.Metadata.Overload("RenameAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncAction RenameAsync(string desiredName, NameCollisionOption option);
function renameAsync(desiredName, option)
Public Function RenameAsync (desiredName As String, option As NameCollisionOption) As IAsyncAction

参数

desiredName
String

Platform::String

winrt::hstring

新名称。

option
NameCollisionOption

一个 值,该值指示在当前文件夹中已存在文件名时要执行的操作。

返回

此方法完成后,不会返回任何对象或值。

实现

M:Windows.Storage.IStorageItem.RenameAsync(System.String,Windows.Storage.NameCollisionOption) M:Windows.Storage.IStorageItem.RenameAsync(Platform::String,Windows.Storage.NameCollisionOption) M:Windows.Storage.IStorageItem.RenameAsync(winrt::hstring,Windows.Storage.NameCollisionOption)
属性

另请参阅

适用于