private void timer1_Tick(object sender, EventArgs e) { try { ARVeg(); pbxProgrss.Width += 5; if (pbxProgrss.Width >= 300) { timer1.Stop(); FrmLogin ObjLog = new FrmLogin(); this.Hide(); ObjLog.ShowDialog(); } } catch (Exception) { return; } }
private void BtnEnviar_Click(object sender, EventArgs e) { System.Net.Mail.MailMessage mmsg = new System.Net.Mail.MailMessage(); mmsg.To.Add(TxtCorreo.Text); mmsg.Subject = "Recuperación de Conraseña By APP-El Palé"; mmsg.SubjectEncoding = System.Text.Encoding.UTF8; mmsg.Body = "La contraseña de la App es adminPALE"; mmsg.BodyEncoding = System.Text.Encoding.UTF8; mmsg.IsBodyHtml = true; mmsg.From = new System.Net.Mail.MailAddress("*****@*****.**"); System.Net.Mail.SmtpClient cliente = new System.Net.Mail.SmtpClient(); cliente.Credentials = new System.Net.NetworkCredential("*****@*****.**", "jhonyr1998"); cliente.Port = 587; cliente.EnableSsl = true; cliente.Host = "smtp.gmail.com"; try { cliente.Send(mmsg); MessageBox.Show("Correo enviado exitosamente"); } catch (Exception error) { MessageBox.Show("", error.Message); } FrmLogin ObjLog = new FrmLogin(); ObjLog.ShowDialog(); this.Close(); }