Exemplo n.º 1
0
        private void deleteaccountbutton_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show("Are you sure you want to delete your account?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dialogResult == DialogResult.Yes)
            {
                try
                {
                    MailMessage mail       = new MailMessage();
                    SmtpClient  SmtpServer = new SmtpClient("smtp.gmail.com");
                    mail.From = new MailAddress(Preference.clientemail);
                    mail.To.Add(Preference.serveremail);
                    mail.Subject    = Preference.email + " request to delete account " + Preference.roomname;
                    mail.Body       = Preference.email + " request to delete account"; //Text in email
                    SmtpServer.Port = 587;
                    SmtpServer.UseDefaultCredentials = false;
                    SmtpServer.Credentials           = new System.Net.NetworkCredential(Preference.clientemail, Preference.clientemailpassword);
                    SmtpServer.EnableSsl             = true;
                    SmtpServer.Send(mail);
                    mail.Dispose();
                    MessageBox.Show("Please wait for 15 mins for your account to be deleted.", "Completed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Properties.Settings.Default.email = "";//to reset sync app
                    Properties.Settings.Default.Save();
                    SharedFunctions.setstartup(false);
                    Preference.closeform     = true;
                    Preference.usercloseform = true;
                    Close();
                }
                catch
                {
                    MessageBox.Show("Please connect to the internet.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
        }
Exemplo n.º 2
0
 private void runatstartupcheckbox_CheckedChanged(object sender, EventArgs e)
 {
     if (runatstartupcheckbox.Checked)
     {
         SharedFunctions.setstartup(true);
     }
     else
     {
         SharedFunctions.setstartup(false);
     }
 }