borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (communicating between programs)Next Topic (Can not press key Delete?) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Store the log in & log out time of a user in a database
Poster Message
tausif82
Level: Trainee

Registered: 05-01-2006
Posts: 1

icon Store the log in & log out time of a user in a database

Hi ,
I need to calculate for how long the a user has been logged on to windows. To be more specific , I need to find out how many times has "x" logged on to windows & store the time he has spent during a single day on his comp.
Any help on how I go about this.? I had earlier thought to create a program that would run in the background & once the user logs in store his Log in time & when store his logout time time when he logs out of his system in a database ... but I dont want to use the system date for log out time as the user can change the system time... Also, I have read the timer control isnt very accurate. Is there any other way out?
Any help would be appreciated  !!!

Tausif

05-01-2006 at 11:29 AM
View Profile Send Email to User Show All Posts | Quote Reply
Dave Green
Level: Professor


Registered: 20-10-2005
Posts: 90
icon Re: Store the log in & log out time of a user in a database

Hi
Your user would not be able to change the system time until after they have logged in, so storing the log in time would be no problem. Elapsed time can be recorded very accurately using the timer control, it may not be accurate when compared to an atomic clock perhaps but for your kind of usage entirely adequate I would think.

Obviously from the log in time and elapsed time the log out time can be calculated.

There is probably a more elegant way of doing this however.

____________________________
While Breath.Count>0
       Live(gbRelax)
Wend

05-01-2006 at 07:07 PM
View Profile Send Email to User Show All Posts | Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: Store the log in & log out time of a user in a database

You may want to look at using the time of a server and not the clients pc. They can change whatever they like then and it won't affect your program.

Here's a link below with some details, but I guess there are more if you have a search.

http://www.andreavb.com/forum/viewtopic.php?TopicID=5959


Steve  

06-01-2006 at 12:02 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : Store the log in & log out time of a user in a database
Previous Topic (communicating between programs)Next Topic (Can not press key Delete?) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder