Solved

Controlling the system's time

Posted on 2003-11-22
16
494 Views
Last Modified: 2010-04-17
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
Comment
Question by:zolpo
  • 6
  • 3
  • 2
  • +4
16 Comments
 

Accepted Solution

by:
DaVx0r earned 50 total points
ID: 9804027
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
 
LVL 1

Author Comment

by:zolpo
ID: 9804067
Thanks DaVx0r!

Visual Basic 6

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



0
 
LVL 22

Assisted Solution

by:cookre
cookre earned 100 total points
ID: 9804204
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
 
LVL 1

Assisted Solution

by:RocketMan801
RocketMan801 earned 100 total points
ID: 9804407
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
 
LVL 1

Author Comment

by:zolpo
ID: 9804520
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
 
LVL 1

Assisted Solution

by:RocketMan801
RocketMan801 earned 100 total points
ID: 9804578
>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
 
LVL 1

Author Comment

by:zolpo
ID: 9804617
RocketMan801 thank you again.

I will be back in a few hours.
0
 
LVL 8

Assisted Solution

by:jhurst
jhurst earned 150 total points
ID: 9804892
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 22

Assisted Solution

by:cookre
cookre earned 100 total points
ID: 9805069
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
 

Assisted Solution

by:Ksproule
Ksproule earned 50 total points
ID: 9805259
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
 
LVL 1

Author Comment

by:zolpo
ID: 9806391
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
 
LVL 1

Author Comment

by:zolpo
ID: 9806406
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
 
LVL 8

Assisted Solution

by:jhurst
jhurst earned 150 total points
ID: 9814476
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
 
LVL 8

Assisted Solution

by:jhurst
jhurst earned 150 total points
ID: 9814485
BTW, here is one that I have used
http://www.timetools.co.uk/tnt-mls-windows-nt.htm
0
 
LVL 7

Assisted Solution

by:sftweng
sftweng earned 50 total points
ID: 9824924
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
 
LVL 1

Author Comment

by:zolpo
ID: 10175405
Thank you for your help.

The points allocated accourding to your participation.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now