/// <summary> /// Database를 모두 저장합니다. /// </summary> public void saveAll(Profile prof) { con.Open(); if (!(prof.Name == null || prof.Id == null || prof.Pwd == null)) { string cmds = "select * from profile"; bool flag = true; SQLiteCommand cmd = new SQLiteCommand(cmds, con); SQLiteDataReader read = cmd.ExecuteReader(); while (read.Read()) { exeCommandWithoutOpen("update profile set name=\'" + prof.Name + "\', id=\'" + Secure.AES256Encrypt(prof.Id) + "\', password=\'" + Secure.AES256Encrypt(prof.Pwd) + "\' where key=" + read["key"]); exeCommandWithoutOpen("update browser set usr_agent=\'" + WebControl.usr_agent + "\', fake_plugin=" + WebControl.fake_plugin + ", use_window=" + WebControl.use_win + ", gpu_acc=" + WebControl.gpu_acc + ", lang=\'" + WebControl.lang + "\' where key=" + read["key"]); flag = false; } read.Close(); if (flag) { exeCommandWithoutOpen("insert into profile (name, id, password) values (\'" + prof.Name + "\', \'" + Secure.AES256Encrypt(prof.Id) + "\', \'" + Secure.AES256Encrypt(prof.Pwd) + "\')"); exeCommandWithoutOpen("update browser set usr_agent=\'" + WebControl.usr_agent + "\', fake_plugin=" + WebControl.fake_plugin + ", use_window=" + WebControl.use_win + ", gpu_acc=" + WebControl.gpu_acc + ", lang=\'" + WebControl.lang + "\' where key=1"); } } con.Close(); Setting.save(); }
public void SaveConfig() { cardDescription.save(); setting.save(); setting.saveWhenQuit(); }