Get Last Element in C# using XElement

前端 未结 5 929
一向
一向 2020-12-07 04:35

I have a XML feed loaded in an XElement.

The structure is





         


        
5条回答
  •  不知归路
    2020-12-07 05:10

    Try this

    XDocument doc= XDocument.Load("path to xml");
    var last=doc.Root.LastNode;
    

提交回复
热议问题