FolderInformation.CreateFileAsync 方法

定义

重载

CreateFileAsync(String)

在当前文件夹中创建新文件。

CreateFileAsync(String, CreationCollisionOption)

在当前文件夹中创建一个新文件,并指定在当前文件夹中已存在同名文件时要执行的操作。

CreateFileAsync(String)

在当前文件夹中创建新文件。

public:
 virtual IAsyncOperation<StorageFile ^> ^ CreateFileAsync(Platform::String ^ desiredName) = CreateFileAsync;
/// [Windows.Foundation.Metadata.Overload("CreateFileAsyncOverloadDefaultOptions")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<StorageFile> CreateFileAsync(winrt::hstring const& desiredName);
[Windows.Foundation.Metadata.Overload("CreateFileAsyncOverloadDefaultOptions")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StorageFile> CreateFileAsync(string desiredName);
function createFileAsync(desiredName)
Public Function CreateFileAsync (desiredName As String) As IAsyncOperation(Of StorageFile)

参数

desiredName
String

Platform::String

winrt::hstring

新文件的名称。

返回

此方法成功完成后,将返回一个代表新文件的 StorageFile

实现

M:Windows.Storage.IStorageFolder.CreateFileAsync(System.String) M:Windows.Storage.IStorageFolder.CreateFileAsync(Platform::String) M:Windows.Storage.IStorageFolder.CreateFileAsync(winrt::hstring)
属性

另请参阅

适用于

CreateFileAsync(String, CreationCollisionOption)

在当前文件夹中创建一个新文件,并指定在当前文件夹中已存在同名文件时要执行的操作。

public:
 virtual IAsyncOperation<StorageFile ^> ^ CreateFileAsync(Platform::String ^ desiredName, CreationCollisionOption options) = CreateFileAsync;
/// [Windows.Foundation.Metadata.Overload("CreateFileAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<StorageFile> CreateFileAsync(winrt::hstring const& desiredName, CreationCollisionOption const& options);
[Windows.Foundation.Metadata.Overload("CreateFileAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StorageFile> CreateFileAsync(string desiredName, CreationCollisionOption options);
function createFileAsync(desiredName, options)
Public Function CreateFileAsync (desiredName As String, options As CreationCollisionOption) As IAsyncOperation(Of StorageFile)

参数

desiredName
String

Platform::String

winrt::hstring

新文件的名称。

options
CreationCollisionOption

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

返回

此方法成功完成后,将返回一个代表新文件的 StorageFile

实现

M:Windows.Storage.IStorageFolder.CreateFileAsync(System.String,Windows.Storage.CreationCollisionOption) M:Windows.Storage.IStorageFolder.CreateFileAsync(Platform::String,Windows.Storage.CreationCollisionOption) M:Windows.Storage.IStorageFolder.CreateFileAsync(winrt::hstring,Windows.Storage.CreationCollisionOption)
属性

另请参阅

适用于