zoukankan      html  css  js  c++  java
  • xml listview

                this.listView1.View = View.Details;
                this.listView1.Scrollable = true;
                this.listView1.MultiSelect = false;
                this.listView1.HeaderStyle = ColumnHeaderStyle.Nonclickable;
                this.listView1.Columns.Add("Changebefore", 60, HorizontalAlignment.Right);
                this.listView1.Columns.Add("Changeafter", 100, HorizontalAlignment.Left);
                this.listView1.Visible = true;

                //From here, we should read the information from changeinfodatase.xml"
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load("changeinfodataset.xml");
                XmlNodeList nodeList = xmlDoc.SelectSingleNode("changeinfo").ChildNodes;//获取changeinfo节点的所有子节点
                foreach (XmlNode xn in nodeList)//遍历所有子节点   获取items节点
                {
                    XmlElement xe = (XmlElement)xn;//将子节点items类型转换为XmlElement类型  
                    XmlNodeList nls = xe.ChildNodes;//继续获取items  xe子节点的所有子节点  
                    ListViewItem lv = new ListViewItem();
                    foreach (XmlNode xn1 in nls)//遍历  
                    {                 
                        XmlElement xe2 = (XmlElement)xn1;//转换类型  
                        if (xe2.Name == "changebefore")//如果找到  
                        {
                            //From here, we get the information "changebefore"               
                            lv.SubItems[0].Text = xe2.InnerText;
                        }
                        if (xe2.Name == "changeafter")
                        {
                            //From here, we get the informatio "changeafter"
                            lv.SubItems.Add(xe2.InnerText);
                        }                  
                    }
                    this.listView1.Items.Add(lv);
                }

  • 相关阅读:
    hadoop2 作业执行过程之作业提交
    Hadoop各个服务端口列表
    基于 Nginx 和 FFmpeg 搭建流媒体服务器
    prometheus
    ubuntu 下dbus的环境搭建和使用
    Hadoop-Error: Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster —
    Exception message: /bin/bash: line 0: fg: no job control
    P3942 将军令 [贪心]
    P3941 入阵曲
    P3941 入阵曲
  • 原文地址:https://www.cnblogs.com/greencolor/p/1637776.html
Copyright © 2011-2022 走看看