Asp.net C# web sitesi için ziyaretçi sayısını nasıl sayabilirim? .aspx sayfasıasp.net web sitesi için ziyaretçi sayısını saymak C#
<asp:Label runat="server" ID="lbluser" />
içinde
global.asax sayfa
<%@ Application Language="C#" %>
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
Application["NoOfVisitors"] = 0;
}
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
Application.Lock();
Application["NoOfVisitors"] = (int)Application["NoOfVisitors"] + 1;
Application.UnLock();
}
yılında: Ben aşağıdaki kodu kullanıyorum
Ben kullanıcı sayısını sayma içinde hatalı sahip .aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
lbluser.Text = Application["NoOfVisitors"].ToString();
}
uygulama sayaç 0'a her bir saat sıfırlıyor ... yılında
? ... teşekkürler ...
Web sitesi bigrocks'ta barındırdım .... bu bilgileri onlara göndereceğim .... –
böylece uygulama havuzu belirli bir süre sonra yeniden başlayacak mı? –