linq to xml 初学 -- 查询语法

mac2022-06-30  119

初学linq  to xml,很方便

string path = ch.GetConfigFile("")+ "SpeedDial.xml"; var sdDoc = XDocument.Load(path); //linq to xml var query = from resource in sdDoc.Descendants("item") where (int)resource.Attribute("parentId") == 0 select new { Sn=resource.Element("sn").Value, Name=resource.Element("name").Value, Icon=resource.Element("icon").Value };

 

转载于:https://www.cnblogs.com/siyunianhua/p/8302150.html

相关资源:2008.精通LINQ数据访问技术pdf及源码
最新回复(0)