System to record when an employee logs into their PC using VB.Net and SQL Database

by andrewCMF on 10/31/2007 7:16:00 PM Hello

I hope this is posted in the correct place, if not the can some point
me in the direction of a suitable Google group.

ok, here's my problem......

When an employee logs into their PC, we want to record the "log in"
time and then the "log off" time at the end of the day and record the
two times in a SQL Database. This is for the purpose of working out
the total hours worked by an employee as we are trailing an flexi-time
system and need to know when someone comes in to work.

I would like to use VB.Net to program such a system but at a bit of a
loss as to...

1/ how to get the employee's username from the PC
2/ how to put the employee's username into the DB

any help or pointers to websites that might help would be grand

cheers

Andrew

 

Re: System to record when an employee logs into their PC using VB.Net and SQL Database

by rowe_newsgroups on 10/31/2007 8:48:00 PM > 1/ how to get the employee's username from the PC

Environment.UserName

> 2/ how to put the employee's username into the DB

SqlConnection, SqlCommand

Thanks,

Seth Rowe

 

Re: System to record when an employee logs into their PC using VB.Net and SQL Database

by Spam Catcher on 11/1/2007 2:10:00 PM andrewCMF <andrew.pennynospam@checkmyfile.com> wrote in
news:1193908547.014251.226560@57g2000hsv.googlegroups.com:

> Hello
>
> I hope this is posted in the correct place, if not the can some point
> me in the direction of a suitable Google group.
>
> ok, here's my problem......
>
> When an employee logs into their PC, we want to record the "log in"
> time and then the "log off" time at the end of the day and record the
> two times in a SQL Database. This is for the purpose of working out
> the total hours worked by an employee as we are trailing an flexi-time
> system and need to know when someone comes in to work.

Are you on an Active Directory?

 

Re: System to record when an employee logs into their PC using VB.Net and SQL Database

by andrewCMF on 11/1/2007 12:28:00 AM Hello

Seth Rowe - Thanks for you reply, Ta.

Spam Catcher - yes we do use active directory. we are running sbs2000
(upgarding to sbs2003 in the not to distant future). Is there
something in there that we can use to log the time an employee logs in
and off?

cheers

Andrew


 

Re: System to record when an employee logs into their PC using VB.Net

by andrewCMF on 11/1/2007 12:33:00 AM Hi Family tree Mike,

Thanks for the pointer, it is a valid point however all our employee's
know to log off at night for security reasons, although they due leave
PCs on for updates as you mentioned.

cheers

Andrew

 

Re: System to record when an employee logs into their PC using VB.Net and SQL Database

by Spam Catcher on 11/1/2007 3:08:00 PM andrewCMF <andrew.pennynospam@checkmyfile.com> wrote in
news:1193927271.195553.99730@d55g2000hsg.googlegroups.com:

> Spam Catcher - yes we do use active directory. we are running sbs2000
> (upgarding to sbs2003 in the not to distant future). Is there
> something in there that we can use to log the time an employee logs in
> and off?

Yes, LogOn/LogOff Auditing is built into Windows/ActiveDirectory:

http://technet.microsoft.com/en-us/library/Bb742436.aspx

You'll then need an EventLog reporting program to generate fancy reports.
Or you can build a service to read the event log and dump the records to a
database.

This method should be more reliable than building a client application as
you're relying on the server's authentication process and everything is
located on your central servers.

Here's some quick code on how to read the event logs:

http://www.freevbcode.com/ShowCode.asp?ID=5658
 

Re: System to record when an employee logs into their PC using VB.Net and SQL Database

by andrewCMF on 11/1/2007 2:49:00 AM Hi,

excellent - thanks for this!! just the ticket!

ta

Andrew