IDictionary rootMap = new Hashtable();
IList items = new ArrayList();
IDictionary itemMap = null;
rootMap.Add("items", items);
rootMap = new Hashtable();
items.Add(rootMap);
itemMap.Add("title", "itemTitle");
itemMap.Add("link", "itemLink");
itemMap.Add("description", "itemDescription");
rootMap.Add("title", "rootTitle");
rootMap.Add("description", "rootDescription");
rootMap.Add("link", "rootLink");
创建有root和子节点的IDictionary object
本文介绍了一种使用Hashtable和ArrayList来创建包含根节点和子节点的IDictionary对象的方法。通过具体的代码示例展示了如何组织数据结构,并为每个节点添加属性如title、link和description。

被折叠的 条评论
为什么被折叠?



