我想在.Net中创建一个不同的项目。它将用于加密和解密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(null);显示以下错误:
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
但是我没有在哪里做错。
需要帮助。
最佳答案
先尝试一下
cnn.ChangePassword(String.Empty);
然后
cnn.ChangePassword((String)null);
要么
cnn.ChangePassword(default(byte[]));
关于c# - Sqlite数据库中的加密和解密?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23564927/