Hashtable/ Dictionary problem (C#.Net)

Search This thread


Senior Member
Aug 18, 2008
Schiller Park
When loading user setting from a file, it stores the values to 3 arrays within the "io profiles" class. the command that loads the data from the file is run through the command "public void Load(int profile)" in the same classes as the 3 arrays. In the LoadScreen form, there is a for loop which collects profiles form the txt file, make a new sealed class, retrieves data from the "io profiles" class, stores the information in the newly made class, and finally stores the class to a block in the hashtable. through each loop, there is a int PIndex which increments and is used as the key for the hashtable.
my problem is that through each loop after it loads the specific profile and leaves the scope of the "io profile" class, it changes the same variable name in all the hashtable items. there is 6 items in the class that is stored to the hashtable and its always the same variable that gets changed "string[] DateTime". i tried making it a int[] like the others, but the same problem was there. stepping through the code didn't show the problem ether. i was recommended by a friend to use Dictionary<K,V> instead, but the same problem existed.

looking online doesn't seem to mention anything about the problem and I'm VERY tempted to complain to microsoft. this isn't the first glitch ive had with the program. I'm using 32bit Visual Studio 2008 on XP: Media Center SP2. im very unsure if its a problem with the program. the problems seem to be specifically related to certain things which are un-related

if you would like to try to code yourself or see cliplets of the code, reply saying you could help and wish to see the code. any help is welcomed