Udostępnij za pośrednictwem


FileRandomAccessStream.OpenTransactedWriteForUserAsync Method

Definition

Overloads

OpenTransactedWriteForUserAsync(User, String)

Opens a writable stream for a user to an existing file given the file's path and the user's information.

OpenTransactedWriteForUserAsync(User, String, StorageOpenOptions, FileOpenDisposition)

Opens a writable stream for a user to a file given a file path and the user's information. If the file does not exist, it can be created using FileOpenDisposition.

OpenTransactedWriteForUserAsync(User, String)

Opens a writable stream for a user to an existing file given the file's path and the user's information.

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

Parameters

user
User

The user account for opening the stream.

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

OpenTransactedWriteForUserAsync(User, String, StorageOpenOptions, FileOpenDisposition)

Opens a writable stream for a user to a file given a file path and the user's information. If the file does not exist, it can be created using FileOpenDisposition.

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

Parameters

user
User

The user account for opening the stream.

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