waf*_*ers 0 c# xml linq linq-to-xml
我是新手,有人可以请帮助我什么类型的"零件",我无法找到正确的类型,因此无法返回对象"零件".谢谢
private ???? load_parts()
{
var element = XElement.Load("xml/suras.xml");
**var** Parts= from var in element.Descendants("part")
orderby var.Attribute("index").Value
select new dictSuras
{
PartIndex = Convert.ToInt32(var.Attribute("index").Value),
PartPosition = Convert.ToInt32(var.Attribute("position").Value),
PartName = var.Attribute("name").Value
};
return Parts;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
137 次 |
| 最近记录: |