我们可以用C#加密方法吗? [英] Can we encrypt a method in C#?

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

问题描述

亲爱的朋友:

我们可以用C#加密像T-sql这样的方法吗?

例如,在T-sql中,我们可以通过插入代码<< With Encryption>>对视图或存储过程进行加密.我们在c#中是否具有用于加密方法的相同代码?

Yours

Dear Friends:

Can we encrypt a method in C# like T-sql?

For example in T-sql we can encrypt a view or stored procedure by inserting the code <<With Encryption>>. Do we have the same code in c# for encrypting a method?

Yours

推荐答案



我认为那不可能,但这取决于您要实现的目标.
如果仅将方法声明为私有还不够,则应混淆代码(字符串/字节/...加密).
我现在正在考虑的另一个疯狂的想法是将您的方法写入文件中,并在需要使用时对其进行解密/加密,但是我认为这不是最好的解决方案.

致以最诚挚的问候
Hi,

I think thats not possible but it depends what you want to achieve.
If declaring your Method as Private isn''t enough you should obfuscate your code (string/byte/...encryption).
Another crazy idea what I''m thinking about now is to write your method in a file and de/encrypt it when you want to use it, but I think it''s not the best solution.

With best Regards


这篇关于我们可以用C#加密方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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