TextReader.ReadToEndAsync Method

Definition

Reads all characters from the current position to the end of the text reader asynchronously and returns them as one string.

public:
 virtual System::Threading::Tasks::Task<System::String ^> ^ ReadToEndAsync();
public virtual System.Threading.Tasks.Task<string> ReadToEndAsync ();
[System.Runtime.InteropServices.ComVisible(false)]
public virtual System.Threading.Tasks.Task<string> ReadToEndAsync ();
abstract member ReadToEndAsync : unit -> System.Threading.Tasks.Task<string>
override this.ReadToEndAsync : unit -> System.Threading.Tasks.Task<string>
[<System.Runtime.InteropServices.ComVisible(false)>]
abstract member ReadToEndAsync : unit -> System.Threading.Tasks.Task<string>
override this.ReadToEndAsync : unit -> System.Threading.Tasks.Task<string>
Public Overridable Function ReadToEndAsync () As Task(Of String)

Returns

Task<String>

A task that represents the asynchronous read operation. The value of the TResult parameter contains a string with the characters from the current position to the end of the text reader.

Attributes

Exceptions

The number of characters is larger than MaxValue.

The text reader has been disposed.

The reader is currently in use by a previous read operation.

Remarks

The TextReader class is an abstract class. Therefore, you do not instantiate it in your code. For an example of using the ReadToEndAsync method, see the StreamReader.ReadToEndAsync method.

Applies to

See also