| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 644 人关注过本帖
标题:TREEVIEW和XML
只看楼主 加入收藏
Amor
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2005-8-16
收藏
 问题点数:0 回复次数:2 
TREEVIEW和XML
private void populateTreeControl(System.Xml.XmlNode document,System.Windows.Forms.TreeNodeCollection nodes)
  {
   foreach (System.Xml.XmlNode node in document.ChildNodes)
   {
    string text = (node.Value != null ? node.Value : (node.Attributes != null && node.Attributes.Count > 0) ?node.Attributes[1].Value : node.Name); //A1
    TreeNode new_child = new TreeNode(text);
    nodes.Add(new_child);
    populateTreeControl(node, new_child.Nodes); //A2
   }
  }
大体是个什么意义??尤其是A1和A2
搜索更多相关主题的帖子: XML TREEVIEW 
2005-08-26 11:18
live41
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:67
帖 子:12442
专家分:0
注 册:2004-7-22
收藏
得分:0 
A2是递归调用,A1应该是读xml文件的属性,读取xml有两种方式,其中一种就是树状节点地读,至于怎么读我倒没有细看,只知道这种读法比较不消耗内存。
2005-08-27 18:26
Amor
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2005-8-16
收藏
得分:0 
就是
string text = (node.Value != null ? node.Value : (node.Attributes != null && node.Attributes.Count > 0) ?node.Attributes[1].Value : node.Name);
这句话看得不是很明白.
2005-08-29 08:35
快速回复:TREEVIEW和XML
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.021640 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved