C#试用版 [英] Trial Version in C#

查看:91
本文介绍了C#试用版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用Visual C#(2.0)开发了(ERP)软件.我应该向客户(客户)提供试用版(ERP).例如,试用期为10天.
问题是:
案例1:
我在2010年1月1日安装了我的ERP,试用期为10天.因此,它应该可以工作到2010年1月20日.但是最终用户将系统日期更改为
2010年1月21日(实际日期为2010年1月2日).现在不会显示试用期已过期(我会在试用期结束时设置消息).
案例2:
今天是日期2010年1月21日,试用期已完成,但是最终用户已将系统日期更改为2010年1月10日.现在它将不起作用.

我的情况是我的软件安装到10天才能工作.试用期不取决于系统日期

**如果单个计算机,没有互联网连接,情况应该可以工作

I developed (ERP)software in visual C#(2.0).I should give trial version(ERP) to my client(customer) .For example trial period is 10days.
Problems are:
Case 1:
i installed my ERP on 01-jan-2010,10 days trial period. so,it should work untill 20-jan-2010.But Enduser has change system date as
21-jan-2010(actual date is 02-jan-2010).now won''t show trial period expired(i set message when trial period completed).
Case 2:
today is date 21-jan-2010,trial period completed,but enduser has change system date change as 10-jan-2010.now its won''t work.

my scenario is when installed my software work untill 10day.trial period should not depend system date

**case should work if single pc,no internet connection

推荐答案

如果您希望它基于实时,那么我会建议使用互联网测试安装和运行时的日期和时间.

因为用户可以轻松更改他们的系统时钟,所以这是我看到的唯一真正的方法.

您可以在此处使用该库:白天,Internet时间服务类 [
If you want it to be based on real time, then I would suggest using the internet to test the date and time when you install and when you run.

Because the user can easily change their system clock, that is the only real way that I see you can do it.

You can use the library here: Daytime, Internet Time Service Class[^] and use the DayTime.GetTime() to get the time from the NIST server.

You can use that to set when the license starts and to check whether it has expired. Of course, then an internet connection would be required.

[Update] So you added the requirement that there is no internet connection.

Without an internet connection, you''re going to have a real hard time doing this. This is the only way that I can see doing it (but that doesn''t mean it is the only way, it''s just the only way I know):

When the license is originally created, write an encrypted value to the registry with the current time and date as the start date.

Then, write the same value to another key and call it something like CurrentTimeDate.

Then, whenever the user opens, closes, and periodically throughout the program, update the CurrentDateTime value.

If the system clock is ever less than the value in that key, then disable your program.

They will still be able to fake the clock some if they keep track of when they closed the program and then reset the system clock every time to a few seconds after they closed it last, but that''s the best I can think of.


如前所述,您需要在安装或首次运行时存储(并加密)DateTime,然后使用NTP进行检查.

我有两篇关于NTP的文章
使用SNTP的DateValidator [一个SNTP C#和VB.NET的客户端 [ ^ ]
As has been mentioned previously, you need to store (and encrypt) the DateTime when either installed or first run as desired then check using NTP.

I have two articles dealing with NTP
DateValidator using SNTP[^] and An SNTP Client for C# and VB.NET[^]


有几种商业解决方案.如果您了解如何使用Google,那么您可能会发现更多.

.Net许可专业 [ ^ ]

SerialShield SDK [ PC Guard [ ^ ]

MaxToCode [ ^ ]

DeployLX [
There are several commercial solutions for this. If you learn how to use google, you''ll probably find even more.

.Net Licensing Pro[^]

SerialShield SDK[^]

PC Guard[^]

MaxToCode[^]

DeployLX[^]


这篇关于C#试用版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆