ExpandoObject.IDictionary<String,Object>.TryGetValue 方法

定义

获取与指定键关联的值。

 virtual bool System.Collections.Generic.IDictionary<System.String,System.Object>.TryGetValue(System::String ^ key, [Runtime::InteropServices::Out] System::Object ^ % value) = System::Collections::Generic::IDictionary<System::String ^, System::Object ^>::TryGetValue;
bool IDictionary<string,object>.TryGetValue(string key, out object value);
abstract member System.Collections.Generic.IDictionary<System.String,System.Object>.TryGetValue : string * obj -> bool
override this.System.Collections.Generic.IDictionary<System.String,System.Object>.TryGetValue : string * obj -> bool
Function TryGetValue (key As String, ByRef value As Object) As Boolean Implements IDictionary(Of String, Object).TryGetValue

参数

key
String

要获取的值的键。

value
Object

此方法返回时,如果找到该键,则包含与指定键关联的值;否则,包含参数类型的 value 默认值。 此参数未初始化传递。

返回

true 如果实现 IDictionary<TKey,TValue> 的对象包含具有指定键的元素,则为 ;否则为 false

适用于