问题描述
不要说英语。我尝试尽可能多地写作。
我想要一种方法来确定地管理系统时间或节目时间。
我正在创建一个特定的程序评估版本。
我创建了一个类库来生成许可文件并检查许可证到期时间。我通过类库将当前时间与特定模块中的许可证到期时间进行比较。
可以控制许可证验证使用Datetime.Compare使用当前时间和许可证时间。但是,如果任意用户有意调整系统时间,则可以无限期地使用该程序。这是因为如果你只保留许可证到期时间和当前时间之间的中间时间(?),你可以继续使用它。
什么我试过了:
这是我试过的想法。
1.我无法将时间与time.windows.com进行比较,因为它不是网络环境。
2. Environment.TickCount有一个时间限制为24.9天。
3. Microsoft.Win32.SystemEvents.TimeChanged假设您使用它,在开始之前您不知道时间是否已提前更改程序。
4.我考虑过如何将Microsoft.Win32.SystemEvents.TimeChanged与许可文件访问时间一起使用。但是,可以无限制地使用。因为你可以把它设置到中间时间。
5.我也考虑了注册表数量。
缺点是如果继续任意运行,你将无法运行它。
Do not speak English well. I try to write as much as possible.
I ask for a way to manage system time or program time with certainty.
I am creating a specific program evaluation version.
I created a class library to generate a license file and check the license expiration time. And I am comparing the current time with the license expiration time in a specific module through the class library.
License validation can be controlled using the current time and license time using Datetime.Compare. However, if an arbitrary user intentionally adjusts the system time, the program can be used indefinitely. This is because if you keep only the middle time (?) Between the license expiration time and the current time, you can continue to use it.
What I have tried:
This is the idea I tried to try.
1. I can not compare time with time.windows.com because it is not a network environment.
2. Environment.TickCount has a time limit of 24.9 days.
3. Microsoft.Win32.SystemEvents.TimeChanged Assuming you use it, you do not know if the time has changed in advance before you start the program.
4. I considered how to use Microsoft.Win32.SystemEvents.TimeChanged together with the license file access time. However, unlimited use is possible. Because you can set it to the middle time.
5. I also considered the registry count.
The disadvantage is that if you continue to run arbitrarily, you will not be able to run it sometime.
推荐答案
这篇关于C#如何关于程序时间控制或系统时间利用率。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!