|
-
Jul 18th, 2001, 07:12 AM
#1
Locking system Date/Time
How can I lock my system's Date/Time to be modified or can I give password for modification of system Date/Time.
Another is how can I access systems uptime from VB application?
-
Jul 29th, 2001, 12:41 AM
#2
Addicted Member
Your first question, "How can I lock my system's Date/Time" is tricky. I haven't seen anything on that - any program can call the Windows API at any time to change these things. However, one way is to run a background program that regularily checks the date/time - if it is out TOO much from when it was last checked - change it back. :-)
Your second question, "how can I access systems uptime from VB application", is a Windows API called GetTickCount (retrieves the number of milliseconds that have elapsed since the system was started).
-
Jul 31st, 2001, 11:57 PM
#3
maybe u wouldnt need a API call for that. maybe something like this:
Dim sTime as String, sDate as String
Private Sub cmdLock_Click()
sTime = Time
sDate = Date
tmrReset.Interval = 1000
End Sub
Private Sub tmrReset_Timer()
Time = sTime
Date = sDate
End Sub
Private Sub cmdUnlock_Click()
tmrReset.Interval = 0
End Sub
This way, even if the clock and/or date is changed by another program, then it will be reset to the time when the Lock button was pressed!!!
and for more protection, just decrease the tmrReset.Interval value!!
-
Aug 1st, 2001, 01:34 PM
#4
Addicted Member
That was not what he was trying to accomplish.
One question was how to stop other programs from changing the date time. You don't simply want to set it back. You have to monitor it - know what it should be ... when it changes TOO MUCH (ie someone has changed it) you want to set it to what it would have been.
Another, he wanted the time since the system started. You could write a program that starts with Windows (WHY-waste resources) or simply use the GetTickCount API.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|