Condividi tramite


JsonObject.GetNamedValue Metodo

Definizione

Overload

GetNamedValue(String, JsonValue)

Ottiene il valore JsonValue specificato o il valore predefinito specificato se non viene trovato alcun valore denominato.

GetNamedValue(String)

Ottiene il valore JsonValue con il nome specificato.

GetNamedValue(String, JsonValue)

Ottiene il valore JsonValue specificato o il valore predefinito specificato se non viene trovato alcun valore denominato.

public:
 virtual JsonValue ^ GetNamedValue(Platform::String ^ name, JsonValue ^ defaultValue) = GetNamedValue;
/// [Windows.Foundation.Metadata.Overload("GetNamedValueOrDefault")]
JsonValue GetNamedValue(winrt::hstring const& name, JsonValue const& defaultValue);
[Windows.Foundation.Metadata.Overload("GetNamedValueOrDefault")]
public JsonValue GetNamedValue(string name, JsonValue defaultValue);
function getNamedValue(name, defaultValue)
Public Function GetNamedValue (name As String, defaultValue As JsonValue) As JsonValue

Parametri

name
String

Platform::String

winrt::hstring

Nome.

defaultValue
JsonValue

Valore predefinito da usare se la proprietà JSON non viene trovata.

Restituisce

JsonValue con il nome specificato o se questo valore non è stato trovato, viene restituito il valore predefinitoValue.

Attributi

Vedi anche

Si applica a

GetNamedValue(String)

Ottiene il valore JsonValue con il nome specificato.

public:
 virtual JsonValue ^ GetNamedValue(Platform::String ^ name) = GetNamedValue;
JsonValue GetNamedValue(winrt::hstring const& name);
public JsonValue GetNamedValue(string name);
function getNamedValue(name)
Public Function GetNamedValue (name As String) As JsonValue

Parametri

name
String

Platform::String

winrt::hstring

Nome.

Restituisce

Valore JsonValue con il nome specificato.

Commenti

Questo metodo deve essere sempre usato con un blocco try/catch perché genera un'eccezione se il nome trovato non è un tipo JsonValue o il nome non viene trovato.

Vedi anche

Si applica a