Acessing hashtables
The only way I can access the keys and values of a hashtable is through a foreach statement. Is there some other way to access individual keys or values like in an arraylist?
Hashtable H = new Hashtable();
Hashtable F = new Hashtable();
H.Add("CA", "California");
H.Add("IL", "Illinois");
string sk= H.Key[0].ToString(); // this doesn't work but need to do something like this
string sv = H.Value[0].ToString();
F.Add(sk, sv);
Should I use another kind of collection?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Garbage21 reputationPosted Aug 9, 2004, 7:27 AM EDT
onez74 reputationPosted Aug 12, 2004, 6:36 AM EDT