473,394 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to prevent system time change?

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
Jul 26 '07 #1
2 5060
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
Jul 26 '07 #2
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Hans Kesting" <ne***********@spamgourmet.comwrote in message
news:c0**************************@news.microsoft.c om...
>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


Jul 30 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: L Mehl | last post by:
Hello -- In a form text field for entering stock symbols, I want to allow only: alpha integer decimal backspace left and right arrows delete shift
22
by: alecjames1 | last post by:
I have a form which the user must complete before closing. I have disabled the window x button and use my own exit button. When selected it checks to see if the user has completed the entries...
2
by: techfuzz | last post by:
I scoured this group and others looking for the best way to disable a button after the first click to prevent multiple submissions, but never did find anything that worked like they said it would. ...
3
by: Damian | last post by:
Hi everyone I'm having an issue with one of our applications. I'm getting the following error when attempting to log in to the site: Server Error in 'xxxxxxxxxxxxxxxx' Application....
6
by: John Smith | last post by:
Hello, I'm a junior in using VB.NET. I encountered the following problem: I have a form with some buttons (change password, change username, logout etc.) and below those buttons I have a...
3
by: Charles Law | last post by:
Sorry for reposting this question, but I did not get a single answer last time, and I'm sure you guys must have some thoughts on the matter. I have a user control which can be dragged and dropped...
1
by: Ronald S. Cook | last post by:
I have an ASPX page wherein I receive an ID of a file to play. http://localhost/fwi/mediaplayer.aspx?id=3 When I go to a browser and type in the above, it works fine. But when I change the 3...
0
by: jehrich | last post by:
Hi Everyone, I am a bit of a hobby programmer (read newbie), and I have been searching for a solution to a SQL problem for a recent pet project. I discovered that there are a number of brilliant...
2
by: Mayer, Stefan | last post by:
Hi, for some other reasons, where i have no influence and no possibility to change it; it is necessary to upload files tempoarily to a temp-folder in my web-project. Allthough the files are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.