473,466 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Preventing the user from changing the system time

vdraceil
236 New Member
Is it possible to find whether the current system date is changed or not with VB6.0 code?All i want to do is to prohibit the user from changing the system time.How can i do that?
Jan 26 '08 #1
2 1722
Killer42
8,435 Recognized Expert Expert
Is it possible to find whether the current system date is changed or not with VB6.0 code?All i want to do is to prohibit the user from changing the system time.How can i do that?
I'd say that as long as the application is running, you could track a couple of things that might help. For instance, there is a"tick count" that indicates the number of times an internal clock has "ticked" since... um, either midnight, or system start-up, I forget which. You could keep track of that, and compare it with the current system time. If they suddenly get 'way out of synch, bingo!

You could also detect quite easily if the time goes backward, in which case it must have been altered. (Unless the user really is going backward in time, but that's probably outside the scope of this discussion). This could include recording the time when your program is closed, and checking the time hasn't gone backward at start-up.

Of course there are things one probably should keep in mind...
  1. If it's the user's PC, then who are you to tell them what they can't do do it?
  2. Windows does sometimes have delays (no, really!) so the fact that the time skips a bit between checks should not be taken as significant. In other words, if you have a timer set up to run every 30 seconds, and suddenly find that the time has changed 5 minutes instead, that might just mean the system was busy for a while.
  3. Windows may have been configured to automatically synchronise the system time with some server somewhere. Which could cause the time to unexpectedly shift in either "direction". You don't (I assume) want your software to suddenly stop and accuse the user of perfidy for no apparent reason.
  4. Two words... Daylight Saving.
  5. You probably should look into Windows "policies". I think Windows can be set up to prevent the user changing the time. (See point 1.)

P.S. Um... actually, I think there's probably a message Windows sends out to all running apps to notify them the system time was changed. So you might just watch that.
Jan 27 '08 #2
werks
220 New Member
tnx killer for the logic


Better Than Yesterday ^^
Jan 27 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

18
by: Elroyskimms | last post by:
I have a table using an identity column as its Primary Key and two columns (table reduced for simplicity) EmployeeNumber and ArrivalTime. CREATE TABLE ( IDENTITY (1, 1) NOT NULL , (10)...
3
by: shortbackandsides.no | last post by:
I've been having trouble preventing users pressing Enter part way down a form so the incomplete form gets submitted. I came up with a possible solution - the code below seems to work in both...
4
by: Baz'noid | last post by:
Hi all, As the size of my database and the number of users grows, i've found a horrible bug in the system with a very simple solution (but i don't know how to implement it)... If two people...
0
by: Chris Millar | last post by:
I have a user control that i wish to extend to change the date when the user selects the numeric up down button. The code explains itself, hope someone can help. any ideas appreaciated.. ...
2
by: John Ninan | last post by:
I am creating Dynamic Usercontrol in Asp.net application. In this application I have a combobox(aspx Page). Which contains various items. Based on item selected I am dynamically populating...
9
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will...
2
by: =?Utf-8?B?YW5vb3A=?= | last post by:
Hello, I am developing a Simple ASP Website with a login page. I want to know how can I change Session ID after login and also Close the current Session after User closes the Window or gets logged...
2
by: brendan_gallagher_2001 | last post by:
HI I am developog an ASP.net site (using vb.net 1.1) which will be accessed by a number of different office locations, where certain users will be assigned a authoriser profile, and others will...
1
by: RLN | last post by:
RE: Access 2003 Current setup is: Front end .mdb (Interface, queries, macros, etc) /Back end .mdb (Database Tables) I'm trying to write some code that will prevent users from getting into the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.