qhnokia

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
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>
posted on 2010-01-10 20:53  其乐无穷  阅读(198)  评论(0编辑  收藏  举报