ConcurrentDictionary<TKey,TValue>.ContainsKey(TKey) ConcurrentDictionary<TKey,TValue>.ContainsKey(TKey) ConcurrentDictionary<TKey,TValue>.ContainsKey(TKey) ConcurrentDictionary<TKey,TValue>.ContainsKey(TKey) Method

定義

判斷 ConcurrentDictionary<TKey,TValue> 是否包含特定索引鍵。Determines whether the ConcurrentDictionary<TKey,TValue> contains the specified key.

public:
 virtual bool ContainsKey(TKey key);
public bool ContainsKey (TKey key);
abstract member ContainsKey : 'Key -> bool
override this.ContainsKey : 'Key -> bool
Public Function ContainsKey (key As TKey) As Boolean

參數

key
TKey TKey TKey TKey

要在 ConcurrentDictionary<TKey,TValue> 中尋找的索引鍵。The key to locate in the ConcurrentDictionary<TKey,TValue>.

傳回

如果 true 包含具有指定索引鍵的項目,則為 ConcurrentDictionary<TKey,TValue>,否則為 falsetrue if the ConcurrentDictionary<TKey,TValue> contains an element with the specified key; otherwise, false.

實作

例外狀況

適用於

另請參閱