public void checkMDP() { Security secure = new Security(); //this.ok = Security.compareToMd5(this.tbMDP.Text,this.mdp); this.ok = this.mdp.Equals(secure.toCaesar(this.tbMDP.Text, 15)); }
public void checkMDP() { Security secure = new Security(); //this.ok = Security.compareToMd5(this.tbMDP.Text,this.mdp); this.ok = this.mdp.Equals(secure.toCaesar(this.tbMDP.Text , 15)); }
public void saveConfig() { //ouverture du fichier de configuration System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); //sauvegarde de l'heure de la sauvegarde //sauvegarde de la minute de la sauvegarde //sauvegarde du chemin du repertoire de destination de la sauvegarde //sauvegarde de l'intervalle en jours entre 2 sauvegardes config.AppSettings.Settings.Remove("heure"); config.AppSettings.Settings.Add("heure", this.tbHour.Text); config.AppSettings.Settings.Remove("minute"); config.AppSettings.Settings.Add("minute", this.tbMinutes.Text); config.AppSettings.Settings.Remove("path"); config.AppSettings.Settings.Add("path", this.tbPath.Text); config.AppSettings.Settings.Remove("period"); config.AppSettings.Settings.Add("period", this.NUDInterval.Value.ToString()); //si la zone de texte permettant de changer le mot de passe est visible //sauvegarde du mot de passe if (this.tbConfirmMDP.Visible == true) { config.AppSettings.Settings.Remove("password"); config.AppSettings.Settings.Add("password", this.tbMDP.Text); } //si la zone de texte permettant de changer le mot de passe administrateur est visible //sauvegarde du mot de passe administrateur if (this.tbConfirmMDPAdmin.Visible == true) { Security sec = new Security(); config.AppSettings.Settings.Remove("passwordAdmin"); config.AppSettings.Settings.Add("passwordAdmin",sec.toCaesar(this.tbMDPAdmin.Text,15)); Serialization.serializeMDPAdmin(sec.toCaesar(this.tbMDPAdmin.Text, 15)); } //sauvegarde du nombre de sauvegardes à conserver config.AppSettings.Settings.Remove("nbSaves"); config.AppSettings.Settings.Add("nbSaves", this.numericUpDown1.Value.ToString()); //sauvegarde des paramètres d'envoi de mails config.AppSettings.Settings.Remove("from"); config.AppSettings.Settings.Remove("MDPFrom"); config.AppSettings.Settings.Remove("SMTP"); config.AppSettings.Settings.Remove("port"); config.AppSettings.Settings.Remove("to"); config.AppSettings.Settings.Remove("SSL"); config.AppSettings.Settings.Add("from", this.tbFrom.Text); config.AppSettings.Settings.Add("MDPfrom", this.tbMDPFrom.Text); config.AppSettings.Settings.Add("SMTP", this.tbSMTP.Text); config.AppSettings.Settings.Add("port", this.tbPort.Text); config.AppSettings.Settings.Add("to", this.tbTo.Text); if (this.cbSSL.Checked) { config.AppSettings.Settings.Add("SSL", "1"); } else { config.AppSettings.Settings.Add("SSL", "0"); } ConfigurationManager.RefreshSection("appSettings"); config.Save(ConfigurationSaveMode.Modified); Serialization.deserializeLastSaveDate(true); }
public void saveConfig() { //ouverture du fichier de configuration System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); //sauvegarde de l'heure de la sauvegarde //sauvegarde de la minute de la sauvegarde //sauvegarde du chemin du repertoire de destination de la sauvegarde //sauvegarde de l'intervalle en jours entre 2 sauvegardes config.AppSettings.Settings.Remove("heure"); config.AppSettings.Settings.Add("heure", this.tbHour.Text); config.AppSettings.Settings.Remove("minute"); config.AppSettings.Settings.Add("minute", this.tbMinutes.Text); config.AppSettings.Settings.Remove("path"); config.AppSettings.Settings.Add("path", this.tbPath.Text); config.AppSettings.Settings.Remove("period"); config.AppSettings.Settings.Add("period", this.NUDInterval.Value.ToString()); //si la zone de texte permettant de changer le mot de passe est visible //sauvegarde du mot de passe if (this.tbConfirmMDP.Visible == true) { config.AppSettings.Settings.Remove("password"); config.AppSettings.Settings.Add("password", this.tbMDP.Text); } //si la zone de texte permettant de changer le mot de passe administrateur est visible //sauvegarde du mot de passe administrateur if (this.tbConfirmMDPAdmin.Visible == true) { Security sec = new Security(); config.AppSettings.Settings.Remove("passwordAdmin"); config.AppSettings.Settings.Add("passwordAdmin", sec.toCaesar(this.tbMDPAdmin.Text, 15)); Serialization.serializeMDPAdmin(sec.toCaesar(this.tbMDPAdmin.Text, 15)); } //sauvegarde du nombre de sauvegardes à conserver config.AppSettings.Settings.Remove("nbSaves"); config.AppSettings.Settings.Add("nbSaves", this.numericUpDown1.Value.ToString()); //sauvegarde des paramètres d'envoi de mails config.AppSettings.Settings.Remove("from"); config.AppSettings.Settings.Remove("MDPFrom"); config.AppSettings.Settings.Remove("SMTP"); config.AppSettings.Settings.Remove("port"); config.AppSettings.Settings.Remove("to"); config.AppSettings.Settings.Remove("SSL"); config.AppSettings.Settings.Add("from", this.tbFrom.Text); config.AppSettings.Settings.Add("MDPfrom", this.tbMDPFrom.Text); config.AppSettings.Settings.Add("SMTP", this.tbSMTP.Text); config.AppSettings.Settings.Add("port", this.tbPort.Text); config.AppSettings.Settings.Add("to", this.tbTo.Text); if (this.cbSSL.Checked) { config.AppSettings.Settings.Add("SSL", "1"); } else { config.AppSettings.Settings.Add("SSL", "0"); } ConfigurationManager.RefreshSection("appSettings"); config.Save(ConfigurationSaveMode.Modified); Serialization.deserializeLastSaveDate(true); }