Udostępnij za pośrednictwem


FileRandomAccessStream.OpenTransactedWriteAsync Method

Definition

Overloads

OpenTransactedWriteAsync(String)

Opens a stream for writing to an existing file given the file's path.

OpenTransactedWriteAsync(String, StorageOpenOptions, FileOpenDisposition)

Opens a stream for writing to a file given a file path. If the file does not exist, it can be created using FileOpenDisposition.

OpenTransactedWriteAsync(String)

Opens a stream for writing to an existing file given the file's path.

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)

Parameters

filePath
String

Platform::String

winrt::hstring

A path to the file to be opened.

Returns

When this method completes, it returns a StorageStreamTransaction containing the random-access stream and methods that can be used to complete transactions.

Attributes

Windows requirements

Device family
Windows 10 Fall Creators Update (introduced in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v5.0)

Applies to

OpenTransactedWriteAsync(String, StorageOpenOptions, FileOpenDisposition)

Opens a stream for writing to a file given a file path. If the file does not exist, it can be created using 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)

Parameters

filePath
String

Platform::String

winrt::hstring

A path to the file to be opened.

openOptions
StorageOpenOptions

A bitwise combination of the enumeration values that specify options for opening the stream.

openDisposition
FileOpenDisposition

An action to take on the file.

Returns

When this method completes, it returns a StorageStreamTransaction containing the random-access stream and methods that can be used to complete transactions.

Attributes

Windows requirements

Device family
Windows 10 Fall Creators Update (introduced in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v5.0)

Applies to