ConfigurationSection.TryGetValue(String, 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

参数

key
String

配置键。 如果 null返回节本身的值。

value
String

此方法返回时,包含节的值(如果存在);否则,为 null.

返回

true 如果找到该值,则为 ;否则,为 false.

适用于