读取XML

 XmlDocument xd = new XmlDocument();
        xd.Load("XML文件路径");

        XmlElement xe = xd["root"];

        XmlElement xeUpLoadResult = xe["Result"];

        for (int i = 0; i < xeUpLoadResult.ChildNodes.Count; i++)
        {
            XmlAttribute _barId = xeUpLoadResult.ChildNodes[i].Attributes["id"];
            XmlAttribute _barUpLoad = xeUpLoadResult.ChildNodes[i].Attributes["size"];

            string barId = _barId.Value;
            string barUpLoad = _barUpLoad.Value;

        }

posted @ 2011-03-25 12:06  Sir。  阅读(182)  评论(0编辑  收藏  举报