📜  如何在 C# 代码示例上读取 XML

📅  最后修改于: 2022-03-11 14:48:59.139000             🧑  作者: Mango

代码示例1
XmlDocument doc = new XmlDocument();
            doc.Load(path);
            doc.Save(Console.Out);

            foreach (XmlNode node in doc.DocumentElement)
            {
                string word_name = node.Attributes[0].Value;
                string word_translation = node["name of node"].InnerText;
            }