using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
namespace 分页实践
{
public partial class 用XML做点击率统计 : System.Web.UI.Page
{
private XmlDocument xmlDoc;
protected void Page_Load(object sender, EventArgs e)
{
LoadXml();
XmlNode node = xmlDoc.FirstChild;
node.InnerText = Convert.ToString(Convert.ToInt32(node.InnerText) + 1);
xmlDoc.Save(Server.MapPath("ClickCount.xml"));
Response.Write(node.InnerText);
xmlDoc = null;
}
private void LoadXml()
{
xmlDoc = new XmlDocument();
xmlDoc.Load(Server.MapPath("ClickCount.xml"));
}
}
}
<ClickCount>10035</ClickCount>