Global中
protected void Application_Start(Object sender, EventArgs e)
{
Application["Counter"] = "0";
}
protected void Session_Start(Object sender, EventArgs e)
{
Application.lock();
Application["Counter"] = Convert.ToInt32(Application["Counter"])+1;
Application.unlock();
}
protected void Session_End(Object sender, EventArgs e)
{
Application.lock();
Application["Counter"] = Convert.ToInt32(Application["Counter"])-1;
Application.unlock();
}