简体   繁体   中英

Determine whether time on Windows machine is updated automatically from server or not

is there any ways to determine whether DateTime is updated automatically on Windows (currently using Windows 10) or not using C#.

I mean, the Windows has function to automatically update date based on your Geo Location from there own servers.

照片显示设置

Exactly what I am doing: I am adding some dates in Registry and every program execution is checking if 2-3 weeks passed from that date or not. I don't want user to change the date backwards and lure my program, that it couldn't determine exactly 2-3 weeks passed or not.

What I have tried: Just Googling and found literally nothing.

More Examples who still couldn't understand what I really need to do: For ex. program has executed on 23th of Nov. It (program) writes this date into Registry. On next execution It reads from Registry that date and comparing to today's date. If 2 weeks passed from the last execution date, it should do something, Exit program for example, but I don't want user to change the System's date by hand and lure program that it has not passed 2 weeks so long.

.NET Version: 4.7

What you're doing, namely preventing users from extending the trial version of your application, might not be worth the effort.

A persistent enough user will use ProcMon and detect the regkey you're reading/writing and clear or update it. Oh, you encrypt it? They'll decompile your executable and find your encryption key.

Or they'll wipe the VM they use and reinstall your trial version after it expired.

Or they will configure a time server that they control, and set back time on that server... And so on.

How many hours will you spend on copy protection that can better be spent on adding features that make your application worth spending money on?

Anyway see the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\NtpServer .

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM