XmlWriter.WriteCharEntity(Char) XmlWriter.WriteCharEntity(Char) XmlWriter.WriteCharEntity(Char) XmlWriter.WriteCharEntity(Char) Method

定義

在衍生類別中覆寫時,強制產生指定之 Unicode 字元值的字元實體。When overridden in a derived class, forces the generation of a character entity for the specified Unicode character value.

public:
 abstract void WriteCharEntity(char ch);
public abstract void WriteCharEntity (char ch);
abstract member WriteCharEntity : char -> unit
Public MustOverride Sub WriteCharEntity (ch As Char)

參數

ch
Char Char Char Char

要產生字元實體的 Unicode 字元。The Unicode character for which to generate a character entity.

例外狀況

字元位在 Surrogate 字組字元範圍 0xd800 - 0xdfff 中。The character is in the surrogate pair character range, 0xd800 - 0xdfff.

在先前的非同步作業完成前呼叫了 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."

範例

請參閱XmlTextWriter.WriteCharEntity如需使用此方法的範例。See XmlTextWriter.WriteCharEntity for an example using this method.

備註

這個方法會寫入的 Unicode 字元的十六進位字元實體參考格式。This method writes the Unicode character in hexadecimal character entity reference format.

這個方法的非同步版本,請參閱WriteCharEntityAsyncFor the asynchronous version of this method, see WriteCharEntityAsync.

適用於