XmlWriter.WriteNmToken(String) XmlWriter.WriteNmToken(String) XmlWriter.WriteNmToken(String) XmlWriter.WriteNmToken(String) Method

定義

當覆寫衍生類別時,請寫出指定的名稱,以確保它是符合 W3C XML 1.0 建議 (https://www.w3.org/TR/1998/REC-xml-19980210#NT-Name) (英文) 的有效 NmToken。When overridden in a derived class, writes out the specified name, ensuring it is a valid NmToken according to the W3C XML 1.0 recommendation (https://www.w3.org/TR/1998/REC-xml-19980210#NT-Name).

public:
 virtual void WriteNmToken(System::String ^ name);
public virtual void WriteNmToken (string name);
abstract member WriteNmToken : string -> unit
override this.WriteNmToken : string -> unit
Public Overridable Sub WriteNmToken (name As String)

參數

name
String String String String

要寫入的名稱。The name to write.

例外狀況

name 不是有效的 NmToken,或者 namenullString.Emptyname is not a valid NmToken; or name is either null or String.Empty.

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

備註

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

適用於