xml内容如下:
<promotion_coupons_get_response>
<tot_results>
200
</tot_results>
<coupons list="true">
<coupon>
<coupon_id>
123456
</coupon_id>
<denominations>
5
</denominations>
<creat_time>
2000-01-01 00:00:00
</creat_time>
<end_time>
2000-01-01 00:00:00
</end_time>
<condition>
500
</condition>
</coupon>
</coupons>
</promotion_coupons_get_response>
加载这个xml文件:
XMLDocument xmlDoc = new XmlDocument();
然后可以通过xmlDoc .Load(...)或xmlDoc.LoadXml(...)方法加载XML文档。
加载完这个xml文档后,我们可以通过下面的方法快速读取节点内的内容。
快速获取xml节点内容的方法为:
1 /// <summary>
2 /// 获取XML结点值
3 /// </summa