IStorageFolder.CreateFileAsync 方法

定義

多載

CreateFileAsync(String)

在目前資料夾中建立新的檔案。

CreateFileAsync(String, CreationCollisionOption)

在目前資料夾中建立新的檔案,並指定如果目前資料夾中已有相同名稱的檔案,該怎麼做。

CreateFileAsync(String)

在目前資料夾中建立新的檔案。

public:
 IAsyncOperation<StorageFile ^> ^ CreateFileAsync(Platform::String ^ desiredName);
/// [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的形式傳回新檔案。

屬性

另請參閱

適用於

CreateFileAsync(String, CreationCollisionOption)

在目前資料夾中建立新的檔案,並指定如果目前資料夾中已有相同名稱的檔案,該怎麼做。

public:
 IAsyncOperation<StorageFile ^> ^ CreateFileAsync(Platform::String ^ desiredName, CreationCollisionOption options);
/// [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

要建立之檔案的所需名稱。

如果目前資料夾中的現有檔案已經有指定的 desiredName,則指定的 CreationCollisionOption 會決定 Windows 如何回應衝突。

options
CreationCollisionOption

列舉值,決定 如果 desiredName 與目前資料夾中現有檔案的名稱相同,Windows 會如何回應。

傳回

當這個方法完成時,它會以 StorageFile的形式傳回新檔案。

屬性

另請參閱

適用於