C#解析XML字符串

xiaoxiao2021-02-28  119

C#解析XML字符串 XmlDocument xx = new XmlDocument(); xx.LoadXml("xml");//加载xml XmlNodeList xxList = xx.GetElementsByTagName("node"); //取得节点名为node的XmlNode集合 foreach (XmlNode xxNode in xxList) { string nodeText = xxNode.InnerText;//返回的是col的文字内容 string childValue = xxNode.Attributes["name"].Value; //col节点name属性值 }
转载请注明原文地址: https://www.6miu.com/read-23561.html

最新回复(0)