设计时间许可.NET DLL [英] Design time licensing .NET DLL

查看:75
本文介绍了设计时间许可.NET DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用针对框架4.0的c#.net开发了一个.NET dll。

现在我需要实现许可功能。



我想实现设计时许可功能,这只是在visual studio的开发时间。



如何实现这一目标?请帮忙..



基本上用户不允许在一段时间后从我的DLL创建对象...



我尝试了什么:



尝试使用GetProcess()mecahism ..但我需要代码才能执行在设计时..NOT运行时

I have developed a .NET dll using c#.net targeted to framework 4.0 .
Now I need to implement the licensing functionality.

I want to implement the Design time licensing feature which is nothing but during the development time in visual studio.

How to achieve this? Please do help..

Basically user is not allowed to create object from my DLL after certain period of time ...

What I have tried:

Tried with GetProcess() mecahism..But I need the code should get executed during design time ..NOT Runtime

推荐答案

这可能但价值很小。正如解释.NET一样,读取IL并不是太难(是的,有些黑客会阻止像Reflector这样的应用程序这样做,但可以解决它们)。一旦你有了IL,就有了源头。您无法阻止确定的黑客破解您的DLL。那么,如何保护你的装配?基本上,您希望锁定每个入口点,以便所有公共方法都必须验证用户是否有权执行该操作,这意味着他们在执行任何其他操作之前都必须调用许可管理器。潜在地,您将不得不使用任何公共方法执行类似的操作,因为.NET允许您使用反射执行代码。
It's possible but of very little value. As .NET is interpreted, it's not too hard to read the IL (yes, there are some hacks that prevent apps like Reflector from doing this but they can be worked around). Once you have the IL, you have the source. There's very little you can do to prevent a determined hacker from cracking your DLL. So, how to protect your assembly? Basically, you want to lock down every entry point so all public methods will have to validate that the user has the rights to do that operation, so that means they will all have to call into the licensing manager before doing anything else. Potentially, you're going to have to do similar things with none public methods as well because .NET allows you to execute code using reflection.


这篇关于设计时间许可.NET DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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