public static void createDB(string path, string password, bool saveConfig, bool encrypt) { SQLiteConnection.CreateFile(path); if (!password.Equals("")) { SQLiteConnection con = new SQLiteConnection("Data Source: " + path + ";"); con.SetPassword(password); } if (saveConfig) { SQLiteConfig config = new SQLiteConfig(); config.dataSource = path; if (!password.Equals("")) { config.password = password; } SQLiteConfigJson.save(config, encrypt); } else { SQLiteConfig config = new SQLiteConfig(); config.dataSource = path; if (!password.Equals("")) { config.password = password; } SQLiteConfigJson.saveTemp(config, encrypt); } }
public static void createDB(string path, bool saveConfig, bool encrypt) { SQLiteConnection.CreateFile(path); if (saveConfig) { SQLiteConfig config = new SQLiteConfig(); config.dataSource = path; SQLiteConfigJson.save(config, encrypt); } else { SQLiteConfig config = new SQLiteConfig(); config.dataSource = path; SQLiteConfigJson.saveTemp(config, encrypt); } }
public static bool connect() { try { SQLiteConfig config = SQLiteConfigJson.openTemp(); connect(config); return(true); } catch { try { SQLiteConfig config = SQLiteConfigJson.open(); connect(config); return(true); } catch { return(false); } } }