C# 如何创建一个简单的基于时间的软件试用版?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/412833/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
C# How can I create a simple time based trial version of my software?
提问by
I have a C# program that I would like to sell and I want to offer a 14 day trial, I understand that all piracy prevention schemes are overcome so I don't want to waste much time doing this. Could anyone offer any suggestion and even some sample code?
我有一个 C# 程序,我想出售,我想提供 14 天的试用期,我知道所有盗版预防方案都已克服,所以我不想浪费太多时间这样做。任何人都可以提供任何建议甚至一些示例代码吗?
Thanks
谢谢
回答by Chris S
My choice would be to store the date of the install (encrypted with a key) in the registry or config file. Look at this each time the application starts.
我的选择是将安装日期(用密钥加密)存储在注册表或配置文件中。每次应用程序启动时都看看这个。
You can protect your app.config file using something like the RsaProtectedConfigurationProvider .
你可以使用类似RsaProtectedConfigurationProvider 的东西来保护你的 app.config 文件。
Obviously if they decompile the source they'll find the key in it, obfuscating might help this a bit, or using public/private key but that is probably an overkill for what you need.
显然,如果他们反编译源代码,他们会在其中找到密钥,混淆可能会有所帮助,或者使用公钥/私钥,但这可能对您的需求来说太过分了。
回答by Oliver Friedrich
Only save way of doing this would insult an online registration of the software, to one of you servers. The software should generate an id on install with fixed system ids used, so the server may identify the software on that system.
只有保存这样做的方法才会侮辱软件的在线注册,到你们其中的一台服务器。软件应该在安装时生成一个使用固定系统 ID 的 ID,因此服务器可以识别该系统上的软件。
Well, I would recommend not to build a trial version, but a free version with limited functionality.
好吧,我建议不要构建试用版,而是构建功能有限的免费版本。
回答by GONeale
I would use .NET Reactor over at www.eziriz.com
我会在www.eziriz.com 上使用 .NET Reactor
回答by ja.
A thief can always turn back the clock to within 14 days of the install, as well as virtualization to achieve the same end. Can you count on net access and have the program phone home for a key?
小偷总是可以在安装后的 14 天内将时钟倒转,以及虚拟化以实现相同的目的。你能指望网络访问并让程序打电话回家找钥匙吗?
HASP is one company that does this full time.
HASP 是一家全职做这件事的公司。
Also, depending on factors such as the size of your target market, your purchase price, your competition, and the ecosystem you're selling to, you might consider that some amount of priracy might be your best marketing tool. Which is the greater risk: that your software is widely pirated, or that your software is lost in the noise and few ever even try it? Some software allegedly owes it success to wide spread piracy (WordStar, dBase, Lotus 1-2-3, iirc). A quick google shows that Chapter 13 of "in search of stupidity" touches on this.
此外,根据目标市场的规模、购买价格、竞争对手以及销售对象的生态系统等因素,您可能会认为一定程度的隐私可能是您最好的营销工具。哪个风险更大:您的软件被广泛盗版,或者您的软件在噪音中丢失而很少有人尝试过?据称,某些软件的成功归功于广泛传播的盗版(WordStar、dBase、Lotus 1-2-3、iirc)。一个快速的谷歌显示“寻找愚蠢”的第13章涉及到这一点。
It's a tough question, good luck.
这是一个棘手的问题,祝你好运。
回答by Wolf5
Store the date of the install encryped as mentioned.
如上所述存储加密的安装日期。
Also store todays date every time the app starts. If the day suddenly has gone back in time, you know they've cheaten and you close the program.
每次应用程序启动时也存储今天的日期。如果这一天突然回到过去,你就知道他们作弊了,你就关闭了程序。
回答by Alex Fort
Just do a nag screen if it's not registered. People are going to steal your software, whether you like it or not. Wasting time on a copy protection system is just going to make it more frustrating when people steal your software.
如果未注册,只需做一个唠叨屏幕。无论您喜欢与否,人们都会窃取您的软件。在复制保护系统上浪费时间只会让人们窃取您的软件时更加沮丧。
A gentle reminder that it's still in the trial stage will probably suit you better, ala WinRar.
一个温和的提醒,它仍处于试用阶段可能更适合你,ala WinRar。
回答by logicnp
If you do not want to waste time in designing a licensing scheme, consider a ready-to-use system like CryptoLicensing- it supports X day trials among other things.
如果您不想在设计许可方案上浪费时间,请考虑使用像CryptoLicensing这样的即用型系统——它支持 X 天试用等。
DISCLAIMER: I work for LogicNP Software, the developers of CryptoLicensing.
免责声明:我为 CryptoLicensing 的开发人员 LogicNP Software 工作。
回答by Debayan Paul
To get the present 'Time' in C you have to use the header file stdlib.h and the function:
要在 C 中获得当前的“时间”,您必须使用头文件 stdlib.h 和函数:
system("echo %time%");
Program:
程序:
main(){
system("echo %time%");
getch();
}
回答by woutervs
Honestly since you are using C# i'd say don't waste time on licensing. If someone wants your program without paying, they will simply open it up with any IL reader and remove your licensing system or just nop it.
老实说,既然您使用的是 C#,我想说不要浪费时间在许可上。如果有人想要你的程序而无需付费,他们只需用任何 IL 阅读器打开它并删除你的许可系统,或者只是不使用它。
As another user said make a free version with limited functinality. Sell the full version hope it's not spreaded too fast on torrent sites.
正如另一位用户所说,制作一个功能有限的免费版本。出售完整版,希望它不会在种子网站上传播得太快。
Or simply remake your application in another language e.g. c++ and use a licensing system that has to connect to a server. Making it slightly harder to reverse engineer.
或者简单地用另一种语言(例如 c++)重新制作您的应用程序,并使用必须连接到服务器的许可系统。使逆向工程稍微困难一些。
Just take notice that whenever your program becomes somewhat popular it will be hacked/cracked.
请注意,每当您的程序变得有些流行时,它就会被黑客入侵/破解。
Simply rely on the honest people or people who use it commercialy and cannot afford to "get caught" using illegal software.
只需依靠诚实的人或将其用于商业用途且无法承受使用非法软件“被捕”的后果。
EDIT* Someone said to use .NET Reactor over at www.eziriz.com If it works as advertised this will only stop people to easily read your code. It won't stop people to reverse engineer it and hack it anyway. The question is how much do you want to pay for protection? (This is basically rewriting it in another programming language only you pay for it. (less time consuming though), again does it work as advertised?)
编辑* 有人说在 www.eziriz.com 上使用 .NET Reactor 如果它像宣传的那样工作,这只会阻止人们轻松阅读您的代码。它不会阻止人们对其进行逆向工程并对其进行破解。问题是您愿意为保护支付多少费用?(这基本上是用另一种编程语言重写它,只需您付费即可。(虽然耗时较少),它是否像宣传的那样工作?)