Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 509
  • Last Modified:

Controlling the system's time

Hi!

I am writing an application that takes the system time and does some caculations. The app will calculate how much time the employee was at work.

The app will be installed on one PC. The app generaly has two bottons; "In" "Out". Every morning the employee will enter his name and will click the IN bottun. And at the end of his work he will click OUT.

The app will work on win9x nt and xp

The problem is that if the user will be able to change the system's time than the app is worthless.

How do I overcome that?

(Please don't tell me "atomic clock" since the pc is not connected to the Internet. also hiding the clock can be unhide or can be changed with time command)
0
zolpo
Asked:
zolpo
  • 6
  • 3
  • 2
  • +4
10 Solutions
 
DaVx0rCommented:
I'm not sure if there is anything you could do through the interface that an employee couldn't undo. There could be a way that you could set a conditional in your progam. You could use this algorithim - if time is changed, set correct time. This way the employee would have no chance of punching out or in with the time changed.

 I am not sure what programming language you are using, so I can't find any code snippets. Hopefully this helps, though.

-DaVx0r
0
 
zolpoAuthor Commented:
Thanks DaVx0r!

Visual Basic 6

Your comment is interesting. I will appreciate your snippets too.



0
 
cookreCommented:
First off, set a BIOS system/admin password.

Then install TweakUI (http://www.microsoft.com/ntworkstation/downloads/PowerToys/Networking/NTTweakUI.asp) and disable the ControlPanel and anything else you think appropriate.

Modify the time collector to do a reboot when it is closed and have it load at boot.

It's not fool-proof, but it will keep honest people honest and deter all but the most determined plodder.

A key stroke grabber may be of some value.


0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
RocketMan801Commented:
the easyest thing is to:
1 - programs start:
     create a variable to store the ACTUAL time  (StartTime)
     create a variable to store a value (TimeWorking)
     start a timer, and each second, increment the timer, so will have the time that the user is connected
2- Programs ends:
    stop the timer
    Get the Actual Time and compare it with the StartTime+TimeWorking,
      if = everything is allrigth, you got the start time, and end time
      if != the user tried to cheat, but still have the hours he's been working, and the Start Time, so you can guess the   end  time and Remark he tried to cheat

the key is store the time that the app has been running




0
 
zolpoAuthor Commented:
RocketMan801!

Thank you so much for your brilliant contribution!

I can think now on a program that runs on the taskbar and calculate the variables you figured.

But some questions are left: What if the employee will close the app, change the clock than fire it up etc? Or accidently someone close the app or system crash etc. How do I maintain these situations? Not mention when there are 10 employees, should I fire up 10 timers?

BTW sometimes we can involve some DB consistency here; since every record has its time stamp, when a NEW record is older than an OLDER one there is a cheat here... probably.
0
 
RocketMan801Commented:
>What if the employee will close the app, change the clock than fire it up etc?
while the timer is running, you can save every second the  TimeWorking value + the user that logged onto the computer, in a FILE, or in the registry, so each time the app is opened again, it cat get the old values.., or split your app in 2 parts:
a part that "intercats with the user" and a part that counts the time, so even is the user closes the 1ยบ part, the time will still be runnig.. is the sistem crashes.. well thats a little bit more dificult.. but the "save in a file" option would still be aceptable..

is there are many users you can, use only one timer, but  you need TimeWorking variable, and a StartTime variable for each user, after all.. a second is a second :)

0
 
zolpoAuthor Commented:
RocketMan801 thank you again.

I will be back in a few hours.
0
 
jhurstCommented:
personally I would purchase some type od devices that could be attached to the computer that has a readable clock.  The X10 interfacce for example.  When I needed to know what time it was I would query that device and ignore the system time.  I would just make sure that the software for loading the time into the external device was not loaded.
0
 
cookreCommented:
Here's a description of how to use the policy editor on Win9x to implement userid based restrictions.
http://www.saas.nsw.edu.au/solutions/poledit.html
0
 
KsprouleCommented:
To ensure that the current date/time on the application PC is correct you can set it with values from a trusted PC on the same network as folllows:

net time \\TrustedPC /set /yes

Where TrustedPC is the name of a PC on your network that can function as a "time server" to make sure the date/time on your application PC is correct.

If you execute this command after the user clicks the "In" and "Out" buttons the application PC will have its date/time set to a known valid value that you can trust.
0
 
zolpoAuthor Commented:
jhurst!

"personally I would purchase some type od devices that could be attached to the computer that has a readable clock."

Can you please be more specific;  can you supply some links to external (or internal) devices which will handle the system's clock.

Thanks.
0
 
zolpoAuthor Commented:
cookre!

I like your link. Give me please some time to learn it.

Ksproule!
Thanks.

But when the PC stands alone we cannot use it. Thank you again for that briliant solution!!!
0
 
jhurstCommented:
X10 has a programmable controller that is relatively easy to read

motorola makes a number of external modems with clocks

And a quick google search showed me a number of fingerprint/time readers for USB ports
0
 
jhurstCommented:
BTW, here is one that I have used
http://www.timetools.co.uk/tnt-mls-windows-nt.htm
0
 
sftwengCommented:
Rocketman801's solution becomes harder to subvert if you run it as a service. How you do that will depend on the tools you're using for development.
0
 
zolpoAuthor Commented:
Thank you for your help.

The points allocated accourding to your participation.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 3
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now