关于.net系统在线人数的统计
lkm00 2009-04-23 10:33:35 在线人数的统计包括正常的退出(例:点击退出按钮)和非正常的退出(从本系统的网页中调转其他网页中),在页面中如何实现。
还有就是session 的timeout的属性在Global.asax文件中什么地方设。
<%@ Application Language="C#" %>
<script runat="server">
void Application_Start(object sender, EventArgs e)
{
}
void Application_End(object sender, EventArgs e)
{
}
void Application_Error(object sender, EventArgs e)
{
}
void Session_Start(object sender, EventArgs e)
{
Session["user_id"] = null;
Session["user_name"] = "";
Session["login_time"] = null;
Session["kind_id"] = null;
Session["kind_name"] = null;
Application["onLine"] = 0;
}
void Session_End(object sender, EventArgs e)
{
Session.Timeout = 8;
Application.Lock();
Application["onLine"] = Convert.ToInt32(Application["onLine"]) - 1;
Application.UnLock();
}
</script>
这样用session.Timeout 对吗?