在C#中我需要将数据保存在字典对象中,如下所示:
Dictionary<string, Dictionary<string, string>> MyDict =
new Dictionary<string, Dictionary<string, string>>();
Run Code Online (Sandbox Code Playgroud)
现在我意识到,在某些情况下,我需要一些其他(不像字典)数据作为主要字典的值.
如果我只是实例主要词典,是否有任何问题或限制.如:
Dictionary<string, object> MyDict = new Dictionary<string, object>();
Run Code Online (Sandbox Code Playgroud)
在对象字段中我可以放字符串,字典,等等..
在此先感谢,最诚挚的问候,史蒂文