This quick how do I shows how to use a Hashtable in C#.
The Hashtable class in C# represents a hashtable. The following code creates a Hashtable:
Add method of Hashtable is used to add items to the hashtable. The method has index and value parameters. The following code adds three items to hashtable.
The following code returns the value of "Author1" key:
The Remove method removes an item from a Hashtable. The following code removes item with index "Author1" from the hashtable:
The following code loops through all items of a hashtable and reads the values.