日期:2014-05-17  浏览次数:20789 次

xml 读值
C# code



<?xml version="1.0"?>
-<ArrayOfanyType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><anyType xmlns:a="http://www.w3.org/2001/XMLSchema" i:type="a:string">AAAA </anyType><anyType xmlns:a="http://www.w3.org/2001/XMLSchema" i:type="a:string">BBB </anyType><anyType xmlns:a="http://www.w3.org/2001/XMLSchema" i:type="a:string">CCC </anyType></ArrayOfanyType>



怎样读取 值????

------解决方案--------------------
http://topic.csdn.net/u/20110222/17/a74697cc-d2bf-4a48-b11f-aa4bff37f135.html
------解决方案--------------------
<?xml version="1.0"?>
-<ArrayOfanyType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
这个【-】是什么东西。

C# code


 System.Xml.XmlDocument xdoc = new System.Xml.XmlDocument();
            xdoc.Load(@"c:\test.xml");

            List<string> result = new List<string>();
            foreach (XmlNode node in xdoc.ChildNodes[1].ChildNodes)
            {
                result.Add(node.InnerText);
            }