How can I find a specific node in my XML?

前端 未结 5 1766
别跟我提以往
别跟我提以往 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:07

    You are really close - you found the game node, why don't you go a step further and just get the name node if it exists as a child under game?

    in your for each loop:

    listBox1.Items.Add(node.SelectSingleNode("game/name").InnerText);
    

提交回复
热议问题