I need to parse a hashtable, which contains another nested hashtable. I'm trying to use a foreach to iterate through each DictionaryEntry, but when it gets to the nested hashtable the value is returned as "System.Collections.Hashtable" instead of the hashtable itself. How can I get to the actual nested hashtable? Code: foreach (DictionaryEntry entry in data) { Debug.WriteLine(entry.Key + ": " + entry.Value); } The code above returns: firstKey: <actual value> secondKey: <actual value> thirdKey: System.Collections.Hashtable Thanks!
The best way to be doing this is using recursion. Have a function that loops through the Hashtable but if you find object is of type list (i.e. Hashtable) instead of normal process call that function once again.