XmlWriter.WriteCData(String) XmlWriter.WriteCData(String) XmlWriter.WriteCData(String) XmlWriter.WriteCData(String) Method

定義

在衍生類別中覆寫時,寫出包含指定文字的 <![CDATA[...]]> 區塊。When overridden in a derived class, writes out a <![CDATA[...]]> block containing the specified text.

public:
 abstract void WriteCData(System::String ^ text);
public abstract void WriteCData (string text);
abstract member WriteCData : string -> unit
Public MustOverride Sub WriteCData (text As String)

參數

text
String String String String

要放在 CDATA 區塊中的文字。The text to place inside the CDATA block.

例外狀況

此文字會導致非語式正確的 XML 文件。The text would result in a non-well formed XML document.

在先前的非同步作業完成前呼叫了 XmlWriter 方法。An XmlWriter method was called before a previous asynchronous operation finished. 在此情況下,會擲回 InvalidOperationException 與「非同步作業已經在進行中」的訊息。In this case, InvalidOperationException is thrown with the message "An asynchronous operation is already in progress."

備註

如果text可能null或是String.Empty,這個方法會寫入空的 CDATA 區塊,例如<! [CDATA]If text is either null or String.Empty, this method writes an empty CDATA block, for example <![CDATA[]

適用於