How to Capture Login and Logout Time and stored into in database using c#.net

Posted by Bageshkumarbagi under C# on 8/3/2013 | Points: 10 | Views : 4905 | Status : [Member] | Replies : 3
How to Capture Login and Logout Time and stored into in database using c#.net. and i need database structure..

Thanks,
Bagesh Kumar Singh
Mark as answer if you have been satisfied



Responses

Posted by: Jitendrasoft09 on: 8/3/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi Bagesh,

Use session to make login and logout and capture it in variable to store in database.

Make your table as below information-

ACCOUNT ID is the unique ID per user
DATE & TIME lists the moments of time tracked in the login or logout history
ACTIVITY identifies the activity performed by the user, 1 is "login", 2 is "logout"

Hope you are clear.


Jitendra Kumar
If my post helps you, plz mark as an answer.

Bageshkumarbagi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rimi1289 on: 8/6/2013 [Member] Starter | Points: 25

Up
0
Down
Try to capture the "Close" window event in case the browser in closed in a hurry.


Bageshkumarbagi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/6/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
CREATE TABLE Users
(UserId int IDENTITY Primary Key,
UserName varchar(20),
....
...
)

CREATE TABLE Logtrack
( TrackId int identity,
UserId int References Users(UserId),
LogTime DATETIME,
Status VARCHAR(5))

UserId is from Users Table
LogTime column is for capturing login/logout times
Status represents the IN or OUT


Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Bageshkumarbagi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response