1、在Application_Start中初始化application["onlineNum"]=0;
2、在Session_Start中增加application["onlineNum"]=(int)application["onlineNum"]+1;
Application.Lock();
if (application["onlineNum"]!= null)
{
application["onlineNum"]=(int)application["onlineNum"]+1;
}
Application.UnLock();
使用时先进行lock()
3、最后在Session_End中减去在线用户数