首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

围观》》》》c# xml解决方法

2012-09-19 
围观》》》》c#xml我的代码如下:(没实现我想要的效果)XDocument xd new XDocument(new XElement(ChargeInfo

围观》》》》c# xml
我的代码如下:(没实现我想要的效果)
XDocument xd = new XDocument(
  new XElement("ChargeInfo",
  new XElement("Material")
  )
  );

  XElement mat = xd.Element("ChargeInfo");
  mat.Add(new XElement("cpucode", "123"),
  new XElement("brandcode", "123"));

这样不能实现让cpucode和brandcode两项在materia节点下,请求高手赐教。。。

[解决办法]
XElement mat = xd.Element("ChargeInfo").Element("Material");

热点排行