2014-05-09 64 views
1

我想在.Net中创建一个不同的项目。这将用于SQLite数据库的加密和解密。我使用了加密的代码,这是工作:在Sqlite数据库中加密和解密?

SQLiteConnection cnn = new SQLiteConnection("Data Source=c:\\test.db3"); 
cnn.Open(); 
cnn.ChangePassword("mypassword"); 

,但我想解密数据库和我使用解密验证码:

SQLiteConnection cnn = new SQLiteConnection("DataSource=c:\\test.db3;Password=mypassword"); 

cnn.Open(); 
cnn.ChangePassword(null); 

但代码cnn.ChangePassword (空值);显示下面的错误:

The call is ambiguous between the following methods or properties: 'System.Data.SQLite.SQLiteConnection.ChangePassword(byte[])' and 'System.Data.SQLite.SQLiteConnection.ChangePassword(string)' 

我发现这个有用的链接,上面的代码

http://gater3.rssing.com/chan-3257136/latest.php

但是我没有在那里我做的错误。

需要帮助。提前感谢。

回答

2

不要先试试这个

cnn.ChangePassword(String.Empty); 

然后

cnn.ChangePassword((String)null); 

cnn.ChangePassword(default(byte[])); 
+0

感谢您的回答... + 1了。 – Mogli