ConfigurationSection.TryGetValue(String, String) Method

Definition

Tries to get the value of this section as a string.

public:
 bool TryGetValue(System::String ^ key, [Runtime::InteropServices::Out] System::String ^ % value);
public bool TryGetValue(string? key, out string? value);
member this.TryGetValue : string * string -> bool
Public Function TryGetValue (key As String, ByRef value As String) As Boolean

Parameters

key
String

The configuration key. If null, the value of the section itself is returned.

value
String

When this method returns, contains the value of the section if it exists; otherwise, null.

Returns

true if the value was found; otherwise, false.

Applies to