实际上我想为数据库增加安全性.问题 [英] Actually i want add security in for database.The problem with it

查看:154
本文介绍了实际上我想为数据库增加安全性.问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上我想为数据库添加安全性.
我的代码是:

Actually i want add security in for database.
and my code is:

public static string Encrypt(string PlainText)
    {
       
        Rijndael rijndaelkey;
	    string passPhrase = "Ecommerce1CrAp5";
	    string initVector = "@4B2c2E4e4F6g2326";
	    rijndaelKey =Rijndael(passPhrase, initVector, 128, 0, 256);
	    return rijndaelKey.Encrypt(PlainText);
    }

public static string Decrypt(string CypherText)
{
            Rijndael rijndaelkey;
	string passPhrase = "Ecommerce1CrAp5";
	string initVector = "@4B2c2E4e4F6g2326";
	Rijndael rijndaelKey =Rijndael(passPhrase, initVector, 128, 0, 256);
	return rijndaelKey.Decrypt(CypherText);
}




但是由于rijndael是类型而不是变量而出现错误
提供解决方案




but am getting error as rijndael is type but not variable
give a solution for it

推荐答案

^ ]是此类的Microsoft示例.我不知道他们是否更改过代码,或者您是否发明了这段代码,或者问题出在哪里,但是Rijndael似乎没有任何构造函数,只有一个静态方法可以返回实例.
Here[^] is the Microsoft sample for this class. I don''t know if they changed it, or if you invented this code, or what the issue is, but Rijndael does not appear to have any constructors, only a static method to return an instance.


这篇关于实际上我想为数据库增加安全性.问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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