StorageFile.OpenAsync Method

Definition

Overloads

OpenAsync(FileAccessMode, StorageOpenOptions)

Opens a random-access stream with the specified options over the specified file.

OpenAsync(FileAccessMode)

Opens a random-access stream with the specified options over the specified file.

OpenAsync(FileAccessMode, StorageOpenOptions)

Opens a random-access stream with the specified options over the specified file.

C#
[Windows.Foundation.Metadata.Overload("OpenWithOptionsAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<IRandomAccessStream> OpenAsync(FileAccessMode accessMode, StorageOpenOptions options);

Parameters

accessMode
FileAccessMode

One of the enumeration values that specifies the type of access to allow.

options
StorageOpenOptions

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

Returns

When this method completes, it returns an IRandomAccessStream that contains the requested random-access stream.

Implements

Attributes

See also

Applies to

WinRT Build 26100 and other versions
Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100

OpenAsync(FileAccessMode)

Opens a random-access stream with the specified options over the specified file.

C#
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<IRandomAccessStream> OpenAsync(FileAccessMode accessMode);

Parameters

accessMode
FileAccessMode

One of the enumeration values that specifies the type of access to allow.

Returns

When this method completes, it returns an IRandomAccessStream that contains the requested random-access stream.

Implements

Attributes

See also

Applies to

WinRT Build 26100 and other versions
Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100