Share via


XmlConvert.VerifyPublicId(String) 方法

定義

如果字串引數中的所有字元都是有效的公用 ID 字元,則會傳回傳入的字串執行個體。

public:
 static System::String ^ VerifyPublicId(System::String ^ publicId);
public static string VerifyPublicId (string publicId);
static member VerifyPublicId : string -> string
Public Shared Function VerifyPublicId (publicId As String) As String

參數

publicId
String

包含要驗證之 ID 的 String

傳回

如果引數中的所有字元都是有效的公用 ID 字元,則為傳入的字串。

備註

不應該傳回傳入引數以外的其他值。 公用識別碼有效的字元不會因 XML 版本而異,因此不需要 XmlVersion 多載。

如需允許字元的詳細資訊,請參閱 XML 1.0 規格 (第四版) 生產環境 [13] PubidChar

如果 參數為 null, ArgumentNullException 將會擲回 。 如果有任何字元不是有效的公用識別碼字元, XmlException 則會擲回 ,其中會擲回第一個無效字元的相關資訊。

適用於