OracleConnectionStringBuilder.TryGetValue(String, Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從此 OracleConnectionStringBuilder中取得對應所提供金鑰的值。
public:
override bool TryGetValue(System::String ^ keyword, [Runtime::InteropServices::Out] System::Object ^ % value);
public override bool TryGetValue(string keyword, out object value);
override this.TryGetValue : string * obj -> bool
Public Overrides Function TryGetValue (keyword As String, ByRef value As Object) As Boolean
參數
- keyword
- String
要取回物品的鑰匙。
- value
- Object
對應於的 keyword值。
傳回
true 若keyword則在連接字串中發現;否則為false。
備註
此 TryGetValue 方法讓開發者能安全地從 中 OracleConnectionStringBuilder 取得值,而無需驗證所提供的金鑰名稱是否有效。 由於 TryGetValue 能優雅地搜尋不存在的金鑰,因此在取得金鑰值前,無需先尋找金鑰的存在。 若呼叫 TryGetValue,且鍵數不存在,則會在 Nothing 參數中放置 null(在 Visual Basic 中value)。