您的位置:首页 > 其它

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

2017-04-10 21:49 141 查看
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("<span style='font-size:20;'>页面访问量</span>
<span style='color:#ffaa55; font-size:40;'>"
+ Application["num"].ToString() + "</span>");

}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: