XmlReader.GetValueAsync XmlReader.GetValueAsync XmlReader.GetValueAsync XmlReader.GetValueAsync Method

定义

异步获取当前节点的值。Asynchronously gets the value of the current node.

public:
 virtual System::Threading::Tasks::Task<System::String ^> ^ GetValueAsync();
public virtual System.Threading.Tasks.Task<string> GetValueAsync ();
abstract member GetValueAsync : unit -> System.Threading.Tasks.Task<string>
override this.GetValueAsync : unit -> System.Threading.Tasks.Task<string>
Public Overridable Function GetValueAsync () As Task(Of String)

返回

当前节点的值。The value of the current node.

异常

在上一次异步操作完成之前调用了 XmlReader 方法。An XmlReader method was called before a previous asynchronous operation finished. 在这种情况下,将通过消息“异步操作已在进行中”引发 InvalidOperationExceptionIn this case, InvalidOperationException is thrown with the message "An asynchronous operation is already in progress".

- 或 --or-

调用了 XmlReader 异步方法,但未将 Async 标志设置为 trueAn XmlReader asynchronous method was called without setting the Async flag to true. 在此情况下,将引发 InvalidOperationException 并显示消息“若要使用 Async 方法,请将 XmlReaderSettings.Async 设置为 True。”In this case, InvalidOperationException is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods."

注解

若要使用此方法,必须设置Async标记,用于trueTo use this method, you must set the Async flag to true.

适用于

另请参阅