I have an ASP.NET application that is hosted on a farm of virtual servers with time problems. The symptoms are that when servers startup or reboot they often come up with a bad system time (potentially hours off).
(Obviously the best answer would be to solve the system problem, but that is currently beyond my control...)
So here's the question: Is there are straight forward way for me to get my ASP.NET application to query an authoritative NTP server on startup and then reset the system clock if needed?
Technical assumptions: * ASP.NET 4.0 * Windows 2008 * Full local admin rights on server
You may be able to do this using WMI (Windows Management Instrumentation) . Though I don't have personal experience with doing so, there are numerous examples out there. To start:
Hope that sets you off in the right direction.
I don't think the application is the right place to be resetting system time. If I'm not mistaken, Windows Time Service can manage this:
http://www.windowsnetworking.com/articles_tutorials/configuring-windows-time-service.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.