private void nowCreateNewUserAccount() { if (metroTextBox5.Text.Length < 3) { MetroMessageBox.Show(this, "Name must be minimum 3 character long..", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (metroTextBox4.Text.Length < 8) { MetroMessageBox.Show(this, "password must be minimum 8 character long..", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (metroTextBox3.Text != metroTextBox3.Text) { MetroMessageBox.Show(this, "password does not matched..", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { saveFileDialog1.Title = "Store at a safe place"; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { StreamWriter sw = new StreamWriter(saveFileDialog1.FileName); sw.WriteLine(key); sw.Close(); } SavingFeatures sf = new SavingFeatures(); sf.NewUserAccount(metroTextBox5.Text, metroTextBox4.Text); Application.Restart(); } }
public KeyManager() { InitializeComponent(); SavingFeatures sf = new SavingFeatures(); key = sf.keyGenerator(); metroTextBox1.Text = key; }
public MainWindow() { InitializeComponent(); SavingFeatures sf = new SavingFeatures(); keys = sf.keyGenerator(); fileLoadSettings(); }
public void saveKey() { saveKeyDialog.Title = "Store at a safe place"; if (saveKeyDialog.ShowDialog() == DialogResult.OK) { SavingFeatures sff = new SavingFeatures(); StreamWriter sw = new StreamWriter(saveKeyDialog.FileName); sw.WriteLine(sff.fullKey()); sw.Close(); } }
private void metroTextBox2_TextChanged(object sender, EventArgs e) { SavingFeatures sf = new SavingFeatures(); if (sf.hashData(metroTextBox2.Text) == sf.getStoredPassword()) { metroCheckBox1.Checked = true; } else { metroCheckBox1.Checked = false; } }
void launcher() { SavingFeatures sf = new SavingFeatures(); timer1.Stop(); this.Hide(); if (File.Exists(sf.pathMain())) { LoginAccount au = new LoginAccount(); au.ShowDialog(); } else { User_Account ua = new User_Account(); ua.ShowDialog(); } }
private void materialRaisedButton1_Click(object sender, EventArgs e) { SavingFeatures sf = new SavingFeatures(); if (sf.hashData(metroTextBox1.Text) == sf.getStoredUsername() && sf.hashData(metroTextBox2.Text) == sf.getStoredPassword()) { this.Hide(); MainWindow mw = new MainWindow(); mw.ShowDialog(); } else if (sf.hashData(metroTextBox1.Text) != sf.getStoredUsername()) { MetroMessageBox.Show(this, "Check Username ..you have entered wrong.", "Wrong entry", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (sf.hashData(metroTextBox2.Text) != sf.getStoredPassword()) { MetroMessageBox.Show(this, "Check Password ..you have entered wrong.", "Wrong entry", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MetroMessageBox.Show(this, "Check Username or Password..you have entered wrong.", "Wrong entry", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void materialRaisedButton1_Click(object sender, EventArgs e) { if (metroTextBox1.Text.Length < 3) { MetroMessageBox.Show(this, "Name must be minimum 3 character long..", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (metroTextBox2.Text.Length < 8) { MetroMessageBox.Show(this, "password must be minimum 8 character long..", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (metroTextBox2.Text != metroTextBox3.Text) { MetroMessageBox.Show(this, "password does not matched..", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { SavingFeatures sf = new SavingFeatures(); sf.NewUserAccount(metroTextBox1.Text, metroTextBox2.Text); this.Hide(); MainWindow mw = new MainWindow(); mw.ShowDialog(); } }