語言

JsonElement.GetProperty 方法

定義

多載

名稱 Description
GetProperty(ReadOnlySpan<Byte>)

得到 JsonElement 一個代表由 utf8PropertyName所識別的必要屬性價值的 。

GetProperty(ReadOnlySpan<Char>)

得到 JsonElement 一個代表由 propertyName所識別的必要屬性價值的 。

GetProperty(String)

得到 JsonElement 一個代表由 propertyName所識別的必要屬性價值的 。

GetProperty(ReadOnlySpan<Byte>)

來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs

得到 JsonElement 一個代表由 utf8PropertyName所識別的必要屬性價值的 。

public:
 System::Text::Json::JsonElement GetProperty(ReadOnlySpan<System::Byte> utf8PropertyName);
public System.Text.Json.JsonElement GetProperty(ReadOnlySpan<byte> utf8PropertyName);
member this.GetProperty : ReadOnlySpan<byte> -> System.Text.Json.JsonElement
Public Function GetProperty (utf8PropertyName As ReadOnlySpan(Of Byte)) As JsonElement

參數

utf8PropertyName
ReadOnlySpan<Byte>

回傳的屬性名稱的 UTF-8 表示(不含位元組Order-Mark(BOM))。

傳回

A JsonElement 代表請求財產的價值。

例外狀況

這個值的 ValueKind 值不是 Object。

未發現任何符合要求名稱的房產。

父母 JsonDocument 已被處理掉。

備註

屬性名稱匹配以序數、大小寫區分的比較方式進行。

如果同一物件的屬性被多次定義,該方法會匹配最後一次定義。

欲了解更多資訊,請參閱 如何使用 System.Text.JSON 撰寫自訂序列化器與解序列器。

另請參閱

適用於

GetProperty(ReadOnlySpan<Char>)

來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs

得到 JsonElement 一個代表由 propertyName所識別的必要屬性價值的 。

public:
 System::Text::Json::JsonElement GetProperty(ReadOnlySpan<char> propertyName);
public System.Text.Json.JsonElement GetProperty(ReadOnlySpan<char> propertyName);
member this.GetProperty : ReadOnlySpan<char> -> System.Text.Json.JsonElement
Public Function GetProperty (propertyName As ReadOnlySpan(Of Char)) As JsonElement

參數

propertyName
ReadOnlySpan<Char>

要傳回其值的屬性名稱。

傳回

A JsonElement 代表請求財產的價值。

例外狀況

這個值的 ValueKind 值不是 Object。

未發現任何符合要求名稱的房產。

父母 JsonDocument 已被處理掉。

備註

屬性名稱匹配以序數、大小寫區分的比較方式進行。

如果同一物件的屬性被多次定義,該方法會匹配最後一次定義。

另請參閱

適用於

GetProperty(String)

來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs
來源:
JsonElement.cs

得到 JsonElement 一個代表由 propertyName所識別的必要屬性價值的 。

public:
 System::Text::Json::JsonElement GetProperty(System::String ^ propertyName);
public System.Text.Json.JsonElement GetProperty(string propertyName);
member this.GetProperty : string -> System.Text.Json.JsonElement
Public Function GetProperty (propertyName As String) As JsonElement

參數

propertyName
String

要傳回其值的屬性名稱。

傳回

A JsonElement 代表請求財產的價值。

例外狀況

這個值的 ValueKind 值不是 Object。

未發現任何符合要求名稱的房產。

propertyName 是 null。

父母 JsonDocument 已被處理掉。

備註

屬性名稱匹配以序數、大小寫區分的比較方式進行。

如果同一物件的屬性被多次定義,該方法會匹配最後一次定義。

另請參閱

適用於