ConcurrentDictionary<TKey,TValue>.IDictionary.Item[Object] ConcurrentDictionary<TKey,TValue>.IDictionary.Item[Object] ConcurrentDictionary<TKey,TValue>.IDictionary.Item[Object] Property

定義

取得或設定與指定之索引鍵相關聯的值。Gets or sets the value associated with the specified key.

property System::Object ^ System::Collections::IDictionary::Item[System::Object ^] { System::Object ^ get(System::Object ^ key); void set(System::Object ^ key, System::Object ^ value); };
object System.Collections.IDictionary.Item[object key] { get; set; }
 Property Item(key As Object) As Object Implements IDictionary.Item

參數

key
Object Object Object

要取得或設定之值的索引鍵。The key of the value to get or set.

屬性值

與指定索引鍵關聯的值;如果 null 不在字典中,或 key 的類型無法指派給 key 的索引鍵類型,則為 ConcurrentDictionary<TKey,TValue>The value associated with the specified key, or null if key is not in the dictionary or key is of a type that is not assignable to the key type of the ConcurrentDictionary<TKey,TValue>.

實作

例外狀況

正在指派值,而 key 的類型無法指派給金鑰類型或 ConcurrentDictionary<TKey,TValue> 的實值型別。A value is being assigned, and key is of a type that is not assignable to the key type or the value type of the ConcurrentDictionary<TKey,TValue>.

適用於

另請參閱