NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Hashtable.Item

Gets or sets the value associated with the specified key.

[C#] In C#, this member is the indexer for the Hashtable class.

[Visual Basic]
Overridable Public Default Property Item( _
   ByVal key As Object _
) As Object
[C#]
public object this[
   object key
] {virtual get; virtual set;}
[C++]
public: __property virtual Object* get_Item(
   Object* key
);
public: __property virtual void set_Item(
   Object* key,
   Object*
);
[JScript]
returnValue = HashtableObject.Item(key);
HashtableObject.Item(key) = returnValue;
-or-
returnValue = HashtableObject(key);
HashtableObject(key) = returnValue;

[JScript] In JScript, you can use the default indexed properties defined by a type, but you cannot explicitly define your own. However, specifying the expando attribute on a class automatically provides a default indexed Item property whose type is Object and whose index type is String.

Arguments [JScript]

key
The key whose value to get or set.

Parameters [Visual Basic, C#, C++]

key
The key whose value to get or set.

Property Value

The value associated with the specified key. If the specified key is not found, Get returns a null reference (in Visual Basic Nothing), and Set creates a new entry with the specified key.

Exceptions

Exception Type Condition
ArgumentNullException key is a null reference (Nothing).
NotSupportedException The Hashtable is read-only and Set is attempted.

See Also

Hashtable Class | Hashtable Members | System.Collections Namespace