XML文件由于格式规范,读写简单,所以非常适宜保存一些程序的配置信息。
下面总结一下在C#中读写XML文件的方法,随时更新。
1、获取某个节点的值。

XDocument xdoc = XDocument.Load(@"dataConfig.xml");
this.TB_MMZS.Text = xdoc.Element("Cost").Element("BookInfo").Element("PageWordCount").Value;
this.TB_MMZS.Text = xdoc.Element("Cost").Element("BookInfo").Element("PageWordCount").Value;
2、查询XML文档。






