共用方式為


FileRandomAccessStream.OpenTransactedWriteAsync 方法

定義

多載

OpenTransactedWriteAsync(String)

開啟資料流程,以在檔案的路徑下寫入現有的檔案。

OpenTransactedWriteAsync(String, StorageOpenOptions, FileOpenDisposition)

開啟資料流程,以在指定檔案路徑的情況下寫入檔案。 如果檔案不存在,可以使用 FileOpenDisposition 建立檔案。

OpenTransactedWriteAsync(String)

開啟資料流程,以在檔案的路徑下寫入現有的檔案。

public:
 static IAsyncOperation<StorageStreamTransaction ^> ^ OpenTransactedWriteAsync(Platform::String ^ filePath);
/// [Windows.Foundation.Metadata.Overload("OpenTransactedWriteAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<StorageStreamTransaction> OpenTransactedWriteAsync(winrt::hstring const& filePath);
[Windows.Foundation.Metadata.Overload("OpenTransactedWriteAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<StorageStreamTransaction> OpenTransactedWriteAsync(string filePath);
function openTransactedWriteAsync(filePath)
Public Shared Function OpenTransactedWriteAsync (filePath As String) As IAsyncOperation(Of StorageStreamTransaction)

參數

filePath
String

Platform::String

winrt::hstring

要開啟之檔案的路徑。

傳回

當這個方法完成時,它會傳回 StorageStreamTransaction ,其中包含可用來完成交易的隨機存取資料流程和方法。

屬性

Windows 需求

裝置系列
Windows 10 Fall Creators Update (已於 10.0.16299.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v5.0 引進)

適用於

OpenTransactedWriteAsync(String, StorageOpenOptions, FileOpenDisposition)

開啟資料流程,以在指定檔案路徑的情況下寫入檔案。 如果檔案不存在,可以使用 FileOpenDisposition 建立檔案。

public:
 static IAsyncOperation<StorageStreamTransaction ^> ^ OpenTransactedWriteAsync(Platform::String ^ filePath, StorageOpenOptions openOptions, FileOpenDisposition openDisposition);
/// [Windows.Foundation.Metadata.Overload("OpenTransactedWriteWithOptionsAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<StorageStreamTransaction> OpenTransactedWriteAsync(winrt::hstring const& filePath, StorageOpenOptions const& openOptions, FileOpenDisposition const& openDisposition);
[Windows.Foundation.Metadata.Overload("OpenTransactedWriteWithOptionsAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<StorageStreamTransaction> OpenTransactedWriteAsync(string filePath, StorageOpenOptions openOptions, FileOpenDisposition openDisposition);
function openTransactedWriteAsync(filePath, openOptions, openDisposition)
Public Shared Function OpenTransactedWriteAsync (filePath As String, openOptions As StorageOpenOptions, openDisposition As FileOpenDisposition) As IAsyncOperation(Of StorageStreamTransaction)

參數

filePath
String

Platform::String

winrt::hstring

要開啟之檔案的路徑。

openOptions
StorageOpenOptions

列舉值的位元組合,指定開啟資料流程的選項。

openDisposition
FileOpenDisposition

要對檔案採取的動作。

傳回

當這個方法完成時,它會傳回 StorageStreamTransaction ,其中包含可用來完成交易的隨機存取資料流程和方法。

屬性

Windows 需求

裝置系列
Windows 10 Fall Creators Update (已於 10.0.16299.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v5.0 引進)

適用於