 |
|
รบกวนสอบถามหน่อยครับผมใส่ค่า Backend ในไฟล์ Global.asax.cs ไปแล้ว ทำไมเวลา User เข้ามาหน้า Web ก็ยังขึ้น แค่ 1 ตลอดเลยอะครับ
Global.asax.cs
protected void Application_Start(object sender, EventArgs e)
{
Application["OnlineNow"] = 0;
}
protected void Session_Start(object sender, EventArgs e)
{
Application.Lock();
Application["OnlineNow"] = Application["OnlineNow"] = +1 ;
Application.UnLock();
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
}
protected void Application_AuthenticateRequest(object sender, EventArgs e)
{
}
protected void Application_Error(object sender, EventArgs e)
{
}
protected void Session_End(object sender, EventArgs e)
{
Application.Lock();
Application["OnlineNow"] = Application["OnlineNow"] = -1;
Application.UnLock();
}
protected void Application_End(object sender, EventArgs e)
{
Application["OnlineNow"] = null;
}
index.aspx
protected void Page_Load(object sender, EventArgs e)
{
this.lblText.Text = Application["OnlineNow"] +"<br>"+ "Online";
}
Tag : .NET, Ms SQL Server 2008, Ms SQL Server 2012, Web (ASP.NET), C#, VS 2010 (.NET 4.x)
|
|
 |
 |
 |
 |
Date :
2014-08-25 22:10:12 |
By :
offonepoint |
View :
1090 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |