实现一个图形化的页面访问计数器

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Application["num"] == null)
            {
                 Application["num"] = 0;
            }
            else
            {
                int k = (int)Application["num"] + 1;
                Application["num"] = k;
            }

            Response.Write("页面访问量
            "
             + Application["num"].ToString() + "");

        }
    }
}

你可能感兴趣的:(C#)