string filename = "operapass.txt";
StreamWriter Writer = new StreamWriter(filename, false, Encoding.UTF8);
string db_way = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Opera Software\\Opera Stable\\Login Data";
string db_field = "logins";
byte[] entropy = null;
string description;
DataTable DB = new DataTable();
string sql = string.Format("SELECT * FROM {0} {1} {2}", db_field, "", "");
using (SQLiteConnection connect = new SQLiteConnection(string.Format("Data Source={0};", db_way)))
{
SQLiteCommand command = new SQLiteCommand(sql, connect);
SQLiteDataAdapter adapter = new SQLiteDataAdapter(command);
adapter.Fill(DB);
int rows = DB.Rows.Count;
for (int i = 0; i < rows; i++)
{
Writer.Write(i + "{" + Environment.NewLine);
Writer.Write("\turl : " + DB.Rows[i][1] + Environment.NewLine);
Writer.Write("\tlogin : " + DB.Rows[i][3] + Environment.NewLine);
byte[] byteArray = (byte[])DB.Rows[i][5];
byte[] decrypted = DPAPI.Decrypt(byteArray, entropy, out description);
string password = new UTF8Encoding(true).GetString(decrypted);
Writer.Write("\tpassword: " + password + Environment.NewLine + "}" + Environment.NewLine + Environment.NewLine);
listBox1.Items.Add(DB.Rows[i][1]);
listBox2.Items.Add(DB.Rows[i][3]);
listBox3.Items.Add(password);
}
}
Writer.Close();
Вот код, выдает ошибку DataBase is locked, почему? Я хочу сделать прогу для резервного копирования паролей из Internet Explorer, Chrome и Opera. Скажите почему эта ошибка?