XmlWriter.WriteCommentAsync(String) 方法    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
异步写出一个包含指定文本的注释 <!--...-->。
public:
 virtual System::Threading::Tasks::Task ^ WriteCommentAsync(System::String ^ text);public virtual System.Threading.Tasks.Task WriteCommentAsync (string text);public virtual System.Threading.Tasks.Task WriteCommentAsync (string? text);abstract member WriteCommentAsync : string -> System.Threading.Tasks.Task
override this.WriteCommentAsync : string -> System.Threading.Tasks.TaskPublic Overridable Function WriteCommentAsync (text As String) As Task参数
- text
- String
要放在注释内的文本。
返回
表示 WriteComment 异步操作的任务。
例外
在上一次异步操作完成之前调用了 XmlWriter 方法。 在此情况下,会引发 InvalidOperationException 并显示消息“异步操作已在进行中。”
- 或 -
调用了 XmlWriter 异步方法,但未将 Async 标志设置为 true。 在这种情况下,将引发 InvalidOperationException 并显示消息“如果要使用异步方法,请将 XmlWriterSettings.Async 设置为 true”。
注解
这是具有相同功能的异步版本 WriteComment。 若要使用此方法,必须将标志设置为 Async true。