TextReader.ReadToEndAsync TextReader.ReadToEndAsync TextReader.ReadToEndAsync TextReader.ReadToEndAsync Method

定义

异步读取从当前位置到文本读取器末尾的所有字符并将它们作为一个字符串返回。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();
[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>
Public Overridable Function ReadToEndAsync () As Task(Of String)

返回

表示异步读取操作的任务。A task that represents the asynchronous read operation. TResult 参数值包括字符串来自当前位置到结束文本读取器字符。The value of the TResult parameter contains a string with the characters from the current position to the end of the text reader.

异常

文本读取器已被释放。The text reader has been disposed.

以前的读取操作当前正在使用读取器。The reader is currently in use by a previous read operation.

注解

TextReader 类是抽象类。The TextReader class is an abstract class. 因此,您实例化它在代码中。Therefore, you do not instantiate it in your code. 有关使用的示例ReadToEndAsync方法,请参阅StreamReader.ReadToEndAsync方法。For an example of using the ReadToEndAsync method, see the StreamReader.ReadToEndAsync method.

适用于

另请参阅