linq to xml 初学 -- 查询语法
初学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 };