sqlcipher 3.x
可使用 SQLiteStudio 打开
密码需要在每次执行前使用
command.CommandText = "PRAGMA key=*******";
command.ExecuteNonQuery();
//类库需要 一下两个, 版本号要一致
Microsoft.Data.Sqlite 2.2.4
SQLitePCLRaw.bundle_sqlcipher 1.1.14
public List<Dictionary<string, object>> GetList(string sql, Dictionary<string, object> parameters)
{
using var connection = new SqliteConnection(ConnectionString);
connection.Open();
var command = connection.CreateCommand();
command.CommandText = "PRAGMA key=****";
command.ExecuteNonQuery();
command.CommandText = sql;
if (parameters != null)
foreach (var p in parameters)
{
command.Parameters.AddWithValue("$" + p.Key, p.Value);
}
usin