<%@ Application Language="C#" %>

<script runat="server">

    void Application_Start(object sender, EventArgs e) 
    {
        Application["mcount"] = 0;
        Application["chatcon"] = "";
        Application["userlist"] = "所有人";
        Application.UnLock();
    }
    
    void Application_End(object sender, EventArgs e) 
    {
        //在应用程序关闭时运行的代码

    }
        
    void Application_Error(object sender, EventArgs e) 
    { 
        //在出现未处理的错误时运行的代码

    }

    void Session_Start(object sender, EventArgs e) 
    {
        Application.Lock();
        Application["mcount"] = Convert.ToInt32(Application["mcount"].ToString()) + 1;
        Application.UnLock(); 
    }

    void Session_End(object sender, EventArgs e) 
    {
        Application.Lock();
        Application["mcount"] = Convert.ToInt32(Application["mcount"].ToString()) - 1;
        Application.UnLock(); 
    }       
</script>
