OracleConnectionStringBuilder.TryGetValue(String, Object) 方法

定義

從此 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值。

傳回

truekeyword則在連接字串中發現;否則為false

備註

TryGetValue 方法讓開發者能安全地從 中 OracleConnectionStringBuilder 取得值,而無需驗證所提供的金鑰名稱是否有效。 由於 TryGetValue 能優雅地搜尋不存在的金鑰,因此在取得金鑰值前,無需先尋找金鑰的存在。 若呼叫 TryGetValue,且鍵數不存在,則會在 Nothing 參數中放置 null(在 Visual Basic 中value)。

適用於

另請參閱