Windows 日期时间?
我正在实现我创建的软件的试用版,现在我想捕获用户对日期时间的任何更改。
我尝试搜索如何获取 BIOS 系统时间,但没有运气,所以这是唯一的方法。
我认为我必须在 Windows 中实现一个钩子来捕获任何更改。如何做到这一点,我见过一些代码,对于像我这样的初级程序员来说非常复杂,所以如果有人可以给出一个简化的示例或至少解释一下它是如何完成的。
I am implementing a Trial Version of the software i have created, now i want to catch any change in the DateTime by the user.
I tried searching how to get bios system time but no luck in that so that is the only way to do it.
I think that i have to implement a hook in the windows to catch any change. How to do it, i have seen couple of codes which was very complicated for a junior programmer like me so if anybody could give a simplified example or at least explain how it's done.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你没有按照你想要的方式去做。这是行不通的。
您可以使用权威的互联网时间服务器或类似的服务器进行检查(或者您可以使用返回当前时间的网络服务来设置您的服务器)。如果您不知道如何操作,只需检查 http:// tycho.usno.navy.mil/cgi-bin/timer.pl
我会补充一点,您可以在这里阅读防止基于时间的复制保护规避?如果您不信任我。
我再讲一个策略。我不确定它是否有效。它有很多很多问题(它在我的机器上运行,但我没有在任何地方测试过)。它很慢(您应该在其线程中运行它,如果出现错误,则会导致线程退出程序)。我不知道是否兼容。不知道低级别用户能否运行。
它会查看 Windows 升级列表并获取最近的一个日期。如果用户从不更新他的窗口,他就会欺骗它。
添加对
C:\Windows\System32\wuapi.dll
的引用。它将生成一个“interop”dll 并添加对其的引用。哦...我以为您使用的是 C# :-) 如果您使用的是 C++,您可以转换代码。下次你将学习放置该语言的标签。
You don't do it the way you want to do. It wouldn't work.
You check with an authoritative internet time server or something similar (or you put up a server of your with a web service that return the current time). If you don't know how to do it, you simply check http://tycho.usno.navy.mil/cgi-bin/timer.pl
I'll add that you can read here Prevent time-based copy protection circumvention? if you don't trust me.
I'll tell another strategy. I'm not sure it can work. It has many many problems (it runs on my machine, but I haven't tested it anywhere). It's slow (you should run it in its thread and if there is an error cause the thread to exit the program). I don't know if it's compatible. I don't know if low level users can run it.
It looks at the list of upgrades for Windows and takes the most recent one date. If the user doesn't ever updates his windows, he will trick it.
Add a reference to
C:\Windows\System32\wuapi.dll
. It will generate an "interop" dll and add a reference to it.Oh... I was supposing you where using C# :-) If you are using C++ you can convert the code. The next time you'll learn to put the tag of the language.