首先我们先添加一个“全局应用程序"然后再里面写代码
protected void Application_Start(object sender, EventArgs e)
{
Application["conte"] = 0;
Application["chat"]="";
TimeoutException te = new TimeoutException();
}
protected void Session_Start(object sender, EventArgs e)
{
Application["conte"] = (int)Application["conte"] + 1;
}
protected void Session_End(object sender, EventArgs e)
{
Application["conte"] = (int)Application["conte"] - 1;
}