在Visual Studio部署程序包中设置Datetime [英] Set the Datetime in Visual studio deployment package

查看:128
本文介绍了在Visual Studio部署程序包中设置Datetime的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在使用Visual Studio 2008进行跟踪版本设置.数据库是MS-Access存储在本地(即客户端计算机)的.

我将到期日期存储在我的数据库和注册表文件中.在应用程序负载中,我检查了当前日期(使用System.DateTime.Now)是否大于到期日期.如果属实,此后该应用程序将不再运行.

这里的问题是,如果用户在自己的机器上更改了日期时间,该工具将在不影响我的追踪版本的情况下运行.


我该如何解决这个问题.

在安装过程中我需要存储失效日期的地方.

注意:此处不使用任何中央数据库.

问候,
Sheik

解决方案

你好,

请通过以下CP中的链接.讨论也一样.
如何计算许可证的试用期而不使用系统日期时间 [ ^ ]
http://www.dreamincode.net/forums/topic/65721-trial-period/ [^ ]
http://stackoverflow. com/questions/1665941/c-sharp-30-days-from-todays-date-for-the-c-sharp-datetime-gurus [
这是来自Code Project的另一个选项:

应用程序试用版 [ 解决方案

Hello,

Please go through below link in CP. It has same discussion.
how can i calculate the trial period of the license without using system datetime[^]
http://www.dreamincode.net/forums/topic/65721-trial-period/[^]
http://stackoverflow.com/questions/1665941/c-sharp-30-days-from-todays-date-for-the-c-sharp-datetime-gurus[^]


There are a lot of different ways you could tackle this problem. It all depends on how badly you want to secure your software. For instance, what you have now is good first-level protection. It stops the person who is basically honest. Your big issue really isn''t that the person will change the date on their machine. So many things depend on that date (if they are part of a domain, for instance, they couldn''t even log on with a computer that has a different date) that it really isn''t feasible to change the system date to defeat your software. More likely they will change your registry key to make the date years in the future.

To prevent the user from changing their system date to defeat your software, simply check the Internet for the correct date. That would easily solve that problem (assuming that the clients are connected to the Internet at least intermittently).

To prevent the user from changing the value in the registry, you could encrypt the value or at least obfuscate it. For instance, if you didn''t want to go to full encryption, you could make a long random string and then insert each number of your date into different positions within the string. Then, you could read only those positions of the string to get your date value back. Full encryption would be better, and it isn''t that hard in C#, it''s just an extra step.

If you really want to go to the next level of protection, you need to start looking into other ways of doing trials. There are a bunch of free tools and tips out there for doing so. Search Google for "30 day trial C#" and you will get all of the advice you need.

Here is another option, right from Code Project:

Application Trial Maker[^]


这篇关于在Visual Studio部署程序包中设置Datetime的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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