How can I find a specific node in my XML?

前端 未结 5 1742
别跟我提以往
别跟我提以往 2021-01-01 22:28

I have to read the xml node \"name\" from the following XML, but I don\'t know how to do it.

Here is the XML:



        
5条回答
  •  一生所求
    2021-01-01 23:00

    Maybe try this

    XmlNodeList nodes = root.SelectNodes("//games/game")
    foreach (XmlNode node in nodes)
    {
        listBox1.Items.Add(node["name"].InnerText);
    }
    

提交回复
热议问题