How to use hashtable? [duplicate]
Possible Duplicate:
When to use a HashTable
Why we use Hashtable in csharp? What is the need of it?
Probably you don't want to use the HashTable (non generic) at all, but rather use the
Dictionary<TKey, TValue>
or the
HashSet<T>
if you only need keys
When to use a HashTable
One easy answer would be "performance" using hashtables to store data makes it possible to find and access the data much faster than iteraing over all objects in a list. Wikipedia has a great (large) article about hash tables in general, which gives a good description about it.
精彩评论