IsAsync Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets a value indicating whether the FileStream was opened asynchronously or synchronously.

Namespace:  System.IO
Assembly:  System.IO (in System.IO.dll)

public virtual bool IsAsync { get; }

Property Value

Type: System..::..Boolean
true if the FileStream was opened asynchronously; otherwise, false.

The IsAsync property detects whether the FileStream handle was opened asynchronously, enabling your code to use the Handle property correctly. In Win32, IsAsync being true means the handle was opened for overlapped I/O, and thus requires different parameters to ReadFile and WriteFile.

You specify this value when you create an instance of the FileStream class using a constructor that has an isAsync, useAsync, or options parameter. When the property is true, the stream utilizes overlapped I/O to perform file operations asynchronously.