|
// The following method does not work in practical applications, and cannot be assigned to Hashtable.
Hashtable ht = new Hashtable ();
for (int i = 0; i <5; i ++)
{
// I want the hash table key value to be dynamic, so I used the variable i
ht.Add (i.toString (), i);
}
I don't know what's wrong, is there any way to solve it!
Is there any other way besides the following ways?
ht.Add (0,0);
ht.Add (1,1);
ht.Add (2,2);
ht.Add (3,3);
..... |
|