ASP.net作计数器问题
我在global.asax中输入如下代码:voidApplication_Start(objectsender,EventArgse){Application["onli...
我在global.asax中输入如下代码:
void Application_Start(object sender, EventArgs e)
{
Application["online"] = 0;
void Session_Start(object sender, EventArgs e)
{
Application.Lock();
int iNum = (int)Application["online"] + 1;
Application.Set("online", iNum);
Application.UnLock();
void Session_End(object sender, EventArgs e)
{
Application.Lock();
int iNum = (int)Application["online"] - 1;
Application.Set("online", iNum);
Application.UnLock();
就按书上写了这些,我让让他在一个新页面上显示:现在在线人数..人,怎么弄? 要再建一个页面?那怎么根global.asax连接上? 展开
void Application_Start(object sender, EventArgs e)
{
Application["online"] = 0;
void Session_Start(object sender, EventArgs e)
{
Application.Lock();
int iNum = (int)Application["online"] + 1;
Application.Set("online", iNum);
Application.UnLock();
void Session_End(object sender, EventArgs e)
{
Application.Lock();
int iNum = (int)Application["online"] - 1;
Application.Set("online", iNum);
Application.UnLock();
就按书上写了这些,我让让他在一个新页面上显示:现在在线人数..人,怎么弄? 要再建一个页面?那怎么根global.asax连接上? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询