Click here to Skip to main content
15,895,370 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi FrNdS !!

How to create and Store Login and LogOut History details of User Logins into DATABASE.

UserId | UserName | Log Date | Duration(login, LogOut)

Thanks,
Posted
Comments
OriginalGriff 16-Apr-12 3:03am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.

Hi ,
Read this it will help you
Here[^]
Best Regards
M.Mitwalli
 
Share this answer
 
Hi,

You can use LoggedIn event of Login control to retrieve the user name when a user logs in :
C#
protected void Login1_LoggedIn(object sender, EventArgs e)
{
    string UserName = Login1.UserName;
    DateTime LoginTime = DateTime.Now;
    // Add code to insert user's log in details in database
}


And you can use LoggedOut event of LoginStatus control to retrieve the user name when a user logs out :
C#
protected void LoginStatus1_LoggedOut(object sender, EventArgs e)
{
    string UserName = HttpContext.Current.User.Identity.Name;
    DateTime LogoutTime = DateTime.Now;
    // Add code to insert user's logs out details in database
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900