JsonElement.GetProperty 方法

定義

多載

GetProperty(ReadOnlySpan<Byte>)

取得 JsonElement,表示 utf8PropertyName 所識別的必要屬性值。

GetProperty(ReadOnlySpan<Char>)

取得 JsonElement,表示 propertyName 所識別的必要屬性值。

GetProperty(String)

取得 JsonElement,表示 propertyName 所識別的必要屬性值。

GetProperty(ReadOnlySpan<Byte>)

來源:
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 表示 (沒有位元組順序標記 (BOM))。

傳回

JsonElement,表示必要屬性值。

例外狀況

找不到具有所要求名稱的屬性。

JsonDocument 已經過處置。

備註

屬性名稱比對會以序數、區分大小寫的比較來執行。

如果相同物件多次定義屬性,則 方法會比對最後一個這類定義。

如需詳細資訊,請參閱 如何使用 System.Text.Json 撰寫自訂序列化程式和還原序列化程式

適用於

GetProperty(ReadOnlySpan<Char>)

來源:
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>

要傳回其值的屬性名稱。

傳回

JsonElement,表示必要屬性值。

例外狀況

找不到具有所要求名稱的屬性。

JsonDocument 已經過處置。

備註

屬性名稱比對會以序數、區分大小寫的比較來執行。

如果相同物件多次定義屬性,則 方法會比對最後一個這類定義。

適用於

GetProperty(String)

來源:
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

要傳回其值的屬性名稱。

傳回

JsonElement,表示必要屬性值。

例外狀況

找不到具有所要求名稱的屬性。

propertyNamenull

JsonDocument 已經過處置。

備註

屬性名稱比對會以序數、區分大小寫的比較來執行。

如果相同物件多次定義屬性,則 方法會比對最後一個這類定義。

適用於