private void finalizado() { if (BWAutodestruccion.CancellationPending == false) { //Se crea una instancia de la clase SoundPlayer //que le pasa como parametro al constructo la ruta del archivo //con la propiedad FileName del OpenFileDialog SoundPlayer player = new SoundPlayer("./explosion-01.wav"); //Llama el metodo Play del SoundPlayer para reproducir el audio,musica,etc player.Play(); BWAutodestruccion.CancelAsync(); try { Process.Start("notepad.exe", "./ficheroMensaje.txt"); } catch (Exception e) { } Thread.Sleep(6500); Application.Exit(); } else { this.Close(); } }
private void btnCancel_Click(object sender, EventArgs e) { BWAutodestruccion.CancelAsync(); finalizado(); }