private void Main_menu_Click(object sender, EventArgs e) { MainFor main = new MainFor(); main.Show(); this.Close(); }
private void BackButton_Click(object sender, EventArgs e) { MainFor mainform = new MainFor(); mainform.Show(); this.Close(); }
private void EnterButton_Click(object sender, EventArgs e) { string text = NameBox.Text; if (text == "") { MessageBox.Show("Введите пожалуйста имя"); return; } MainFor mainForm = new MainFor(); OurInfo info = new OurInfo(); info.textBox1_TextChanged(text); try { string fileName = "C:\\Users\\Result.txt"; using (StreamWriter sw = new StreamWriter(new FileStream(fileName, FileMode.Create, FileAccess.Write))) { sw.WriteLine($"Ваше имя {text} вы заходили в программу{ DateTime.Now}"); } } catch { MessageBox.Show("Запустите программу от имени администратора"); return; } mainForm.Show(); this.Hide(); }
void Next() { if (check <= 9) { CheckResult(); DataBase(check); } if (check == 10) { next.Text = "Завершить"; } if (check >= 11) { for (int i = 0; i < User_Answer.Length - 2; i++) { if (User_Answer[i + 1] == correct_Answer[i]) { result++; } } MessageBox.Show($"Вы дали {result} верных ответов"); this.Close(); MainFor main = new MainFor(); main.Show(); } check++; }
private void Backutton_Click(object sender, EventArgs e) { check--; if (check >= 0) { DataBase(check); } else { MainFor main = new MainFor(); main.Show(); this.Close(); } }