Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 XML,其中有重复的节点。是否可以从 C# 中的所有节点获取数据?
一>信息1 /一>
一>信息2 /一>
你可以试试这个:
XDocument doc1 = XDocument.Load(Path);
parentNodes = doc1.Descendants("a") .Select(x => x.Value) .ToList();
该列表包含“Info1”、“Info2”