How to prevent system time change?

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

I know, it is old question. Is there some new way to protect system
time changes with C# 2.0?

What is the best way based on your oppinion?

Thanks, I appreciate your help.

Mike
 
I know, it is old question. Is there some new way to protect system
time changes with C# 2.0?

What is the best way based on your oppinion?

Thanks, I appreciate your help.

Mike

I don't think this is possible. System clock change is an OS function (or
even BIOS) and C# (or rather the .Net framework) runs on top of the OS.
I don't think it's possible to prevent the OS from doing something, as this
would also mean that your application needs to be running the whole time.

But maybe you can contact a timeserver (NTP protocol) to see if the local
time differs from "real time" (but remember to adjust for timezones and
daylight savings time - use UTC?). However, this requires internet access.

Hans Kesting
 
The only thing that comes close to this would be to revoke the user's
SeSetSystemTime privilege. This will prevent them from being able to set
the system time. Of course, you have to have the authority to make that
change to the system yourself.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top