protected void Application_AuthenticateRequest(Object sender, EventArgs e)
{
string strUserID = string.Empty;
string strCompany = string.Empty;
if (Request.IsAuthenticated)
{
FormsIdentity identity = (FormsIdentity)User.Identity;
FormsAuthenticationTicket ticket = identity.Ticket;
strUserID = User.Identity.Name;
strCompany = ticket.UserData.Split("|".ToCharArray())[2];
}
else
{
strUserID = Request.UserHostAddress;
strCompany = "游客";
}
MemberOnlineInfo objOnline = new MemberOnlineInfo(strUserID, Request.UserHostAddress, DateTime.Now.ToString(), Request.FilePath, strCompany);
MemberAccount account = new MemberAccount();
if (!account.CheckUserOnline(strUserID))
account.AddOnline(objOnline);
else
account.UpdateOnline(objOnline);
//删除超时的会员
account.DeleteOnline();
}
地址来源点这里....