共用方式為


IReadOnlyDictionary<K, T>.TryGetValue 方法

Gets the value associated with the specified key.

命名空間:  Microsoft.SqlServer.Management.Sdk.Sfc
組件:  Microsoft.SqlServer.Management.Sdk.Sfc (在 Microsoft.SqlServer.Management.Sdk.Sfc.dll 中)

語法

'宣告
Function TryGetValue ( _
    key As K, _
    <OutAttribute> ByRef value As T _
) As Boolean
'用途
Dim instance As IReadOnlyDictionary 
Dim key As K
Dim value As T
Dim returnValue As Boolean 

returnValue = instance.TryGetValue(key, _
    value)
bool TryGetValue(
    K key,
    out T value
)
bool TryGetValue(
    K key, 
    [OutAttribute] T% value
)
abstract TryGetValue : 
        key:'K * 
        value:'T byref -> bool
function TryGetValue(
    key : K, 
    value : T
) : boolean

參數

  • key
    型別:K
    The key of the value to get.
  • value
    型別:T%
    When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.

傳回值

型別:System.Boolean
true if the specified key is found in the dictionary; otherwise, false.

請參閱

參考

IReadOnlyDictionary<K, T> 介面

Microsoft.SqlServer.Management.Sdk.Sfc 命名空間