// Evenement de la confirmation private void confirmer_Click(object sender, RoutedEventArgs e) { StreamReader sr1 = new StreamReader(@"son.txt"); string str = sr1.ReadLine(); sr1.Close(); if (str == "Activé")// si le son est acitvé ===> le click provoquera un son { MediaPlayer player = new MediaPlayer(); player.Open(new Uri(@"..\..\click.mp3", UriKind.RelativeOrAbsolute)); player.Play(); } /*********************************************************************************************************** * Controles de saisi * *********************************************************************************************************/ if ((passwd.Password == "")) // si l'admin n'a saisi aucun mot de passe { text3.Visibility = Visibility.Visible; text3.Text = "Champ obligatoire "; // affichage de ce texte } else { text3.Text = ""; // recupération du mot de passe saisi dans un chaine if (icon1.Visibility == Visibility.Visible) { text2.Text = passwd.Password; } else { passwd.Password = text2.Text; } StreamReader sr = new StreamReader("passwd.txt"); // recuperation du mot de passe du fichier str = sr.ReadLine(); if (str == passwd.Password) // comparaison entre les deux chains si c'est la bonne : { /// =====> Mise a jour text2.Clear(); text3.Text = ""; passwd.Clear(); mise_a_jour mise = new mise_a_jour(wilaya, output_out); mise.Show(); this.Close(); } else //sinn { /// ===> resaisi du mot de passe text3.Text = "Le mot de passe est incorrect"; text3.Visibility = Visibility.Visible; } } }
private void mise_ajr(object sender, RoutedEventArgs e) { StreamReader sr = new StreamReader(@"son.txt"); string str = sr.ReadLine(); sr.Close(); if (str == "Activé") { MediaPlayer player = new MediaPlayer(); player.Open(new Uri(@"..\..\click.mp3", UriKind.RelativeOrAbsolute)); player.Play(); } mise_a_jour mise = new mise_a_jour(wilaya, output_out); mise.Show(); this.Close(); }
private void mise_ajr(object sender, RoutedEventArgs e) { StreamReader sr = new StreamReader(@"son.txt"); string str = sr.ReadLine(); sr.Close(); if (str == "Activé") { MediaPlayer player = new MediaPlayer(); player.Open(new Uri(@"..\..\click.mp3", UriKind.RelativeOrAbsolute)); player.Play(); } mise_a_jour mise = new mise_a_jour(wilaya, output_out); mise.Show(); this.Close(); //connexion mise = new connexion(wilaya, output_out); //mise.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; //mise.ShowDialog(); //this.Close(); }
private void Window_KeyDown(object sender, KeyEventArgs e) { switch (e.Key) { case Key.A: { accueil ev = new accueil(wilaya, output_out); ev.Show(); this.Close(); } break; case Key.M: { meteo_jour ev = new meteo_jour(wilaya, output_out); ev.Show(); this.Close(); } break; case Key.P: { prevision ev = new prevision(wilaya, output_out); ev.Show(); this.Close(); } break; case Key.E: { evolution ev = new evolution(wilaya, output_out); ev.Show(); this.Close(); } break; case Key.T: { Contact ev = new Contact(wilaya, output_out); ev.Show(); this.Close(); } break; case Key.R: { parametre ev = new parametre(wilaya, output_out); ev.Show(); this.Close(); } break; case Key.O: { apropos ev = new apropos(wilaya, output_out); ev.Show(); this.Close(); } break; case Key.D: { credit ev = new credit(wilaya, output_out); ev.Show(); this.Close(); } break; case Key.Z: { mise_a_jour mise = new mise_a_jour(wilaya, output_out); mise.Show(); this.Close(); } break; case Key.S: { StreamReader sr = new StreamReader(@"son.txt"); string str = sr.ReadLine(); sr.Close(); if (str == "Activé") { MediaPlayer player = new MediaPlayer(); player.Open(new Uri(@"..\..\screen.mp3", UriKind.RelativeOrAbsolute)); player.Play(); } //déclaration et instanciation de la fenêtre parcourir SaveFileDialog parcourir = new SaveFileDialog(); parcourir.DefaultExt = "png"; //je spécifie que seul les images .png sont selectionnables parcourir.Filter = " Fichier PNG (*.PNG)|*.png"; //ouverture de la fenêtre parcourir parcourir.ShowDialog(); CreateScreenShot(this, parcourir.FileName); } break; } }