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 中引入)

适用于