1
我在DB Browser for SQLite中爲我的數據庫設置了加密密鑰,現在我無法在C#中訪問它。System.Data.SQLite - 無法訪問加密數據庫
下面是相關代碼:
private SQLiteConnection connection;
public DbManager()
{
connection = new SQLiteConnection("Data Source=DB\\gamedb.encrypted.sqlite;Password=p4ssw0rd;Version=3;");
connection.Open();
}
下SQLiteCommand
拋出一個異常:「文件加密或不是一個數據庫」。
public Dictionary<string, string> ReadMaps()
{
SQLiteDataReader reader = new SQLiteCommand("select * from Map", connection).ExecuteReader();
Dictionary<string, string> res = new Dictionary<string, string>();
while (reader.Read())
res[(string)reader["Name"]] = (string)reader["Data"];
return res;
}
DB瀏覽器中指定的密鑰與密碼不同嗎?
你有沒有其實加密它在某些時候?在未加密的數據庫文件上使用PW會導致錯誤PW – Plutonix
我不確定,我認爲設置加密密鑰會加密文件 – mkkekkonen
DBBrowser在哪裏做?我從來沒有找到在哪裏告訴它什麼關於加密PW – Plutonix