PropertyDictionary.TryGetValue(String, Object) 方法

定義

取得與指定金鑰相關聯的值。

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

參數

key
String

關鍵在於價值。

value
Object

當方法回傳時,若找到該鍵,則與指定鍵相關聯的值;否則,則為該值參數型別的預設值。 這個參數會未初始化傳遞。

傳回

true如果字典包含具有指定鍵的元素;否則,。 false

適用於