且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我想在C#Windows应用程序中仅使用我的客户端应用程序15天

更新时间:2023-11-14 10:21:58

是.
但是...

而且这是一个很大的但是"-如果人们愿意的话,要绕过它从来没有那么困难,除非您进行在线检查.例如,更改系统日期非常容易,并且会愚弄基本系统.

这取决于您要保护代码的数量以及要付出的努力(以及要冒给潜在客户造成烦恼的风险)

Google可以在这里为您提供帮助(尝试使用演示版c#"-这将为您提供大量有用的结果),或者在此处查看: ^ ]
Yes.
But...

And it''s a fairly big "but" - it''s never that difficult to get round, if people want to, unless you do an online check. Changing the system date (for example) is pretty easy, and will fool basic systems.

It depends how much you want to protect your code, and how much effort you want to put in (and how much you want to risk annoying potential customers)

Google can help you here (try "demo version c#" - that will give you a large set of useful results), or see here: Application Trial Maker[^]


是的,您可以在15天后限制您的应用程序不运行.

只需在主要启动表单上编写以下代码:


DateTime dtAppBuild = System.IO.File.GetLastWriteTime(Application.ExecutablePath);
if(dtAppBuild.AddDays(15)< DateTime.Now)Application.Exit();
Yes u can restrict your application after 15 days to not run.

Just write the following code on main startup form:


DateTime dtAppBuild = System.IO.File.GetLastWriteTime(Application.ExecutablePath);
if (dtAppBuild.AddDays(15) < DateTime.Now) Application.Exit();