读取和写入xml问题
写入时出现问题
xml文件
<?xml version="1.0" encoding="utf-8" ?> <Read> <ReadCount>0</ReadCount> </Read>程序代码
程序代码:
string lj = Server.MapPath("/Count.xml"); XmlDocument xml = new XmlDocument(); xml.Load(lj); xml.SelectNodes("Read//ReadCount"); xml.InnerText = (int.Parse(xml.InnerText) + 1).ToString(); xml.Save(lj);