Form1.cs 863 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace Semenov
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. }
  18. private void button1_Click(object sender, EventArgs e)
  19. {
  20. if (textBox1.Text == "admin" && textBox2.Text == "12345")
  21. {
  22. Form2 form2 = new Form2();
  23. form2.Show();
  24. this.Hide();
  25. }
  26. else;
  27. {
  28. MessageBox.Show("Пароль верен");
  29. }
  30. }
  31. private void button2_Click(object sender, EventArgs e)
  32. {
  33. Close();
  34. }
  35. }
  36. }