草庐IT

confirmado

全部标签

c# - 更有效地过滤 XDocument

我想使用XML文档中的高性能XML元素进行过滤。以这个包含联系人的XML文件为例:Name1xxxx@zzzz.esSIName2xxxxxxxxx@zzzze.esSinconfirmar我当前用于从该XML文档中过滤的代码:usingSystem;usingSystem.Xml.Linq;classTest{staticvoidMain(){stringxml=@"thexmlabove";XDocumentdoc=XDocument.Parse(xml);foreach(XElementelementindoc.Descendants("contact")){Console.Wr