JsonElement.GetGuid 方法

定义

获取元素的值(Guid 形式)。Gets the value of the element as a Guid.

public:
 Guid GetGuid();
public Guid GetGuid ();
member this.GetGuid : unit -> Guid
Public Function GetGuid () As Guid

返回

Guid

元素的值(Guid 形式)。The value of the element as a Guid.

例外

此值的 ValueKind 不是 StringThis value's ValueKind is not String.

此值不能以 Guid 形式表示。The value cannot be represented as a Guid.

已释放父级 JsonDocumentThe parent JsonDocument has been disposed.

注解

此方法不会创建 JSON 字符串以外的值的 Guid 表示形式。This method does not create a Guid representation of values other than JSON strings.

适用于