Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows.Forms;
- namespace Zad2
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- if (LoginTextBox.Text != "" && PasswordTextBox.Text != "" && ConfirmPasswordTextBox.Text != "")
- {
- if (PasswordTextBox.Text.Length < 6)
- {
- MessageBox.Show("Пароль должен содержать не меньше 6 символов");
- }
- else
- {
- if (PasswordTextBox.Text != ConfirmPasswordTextBox.Text)
- {
- MessageBox.Show("Пароли не совпадают");
- }
- else
- {
- User user = new User(LoginTextBox.Text,PasswordTextBox.Text);
- Main main = new Main(user);
- main.ShowDialog();
- }
- }
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- Application.Exit();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- PasswordTextBox.PasswordChar = '*';
- ConfirmPasswordTextBox.PasswordChar = '*';
- }
- }
- public class User
- {
- private string _login;
- private string _password;
- public string Login => _login;
- public string Password => _password;
- public User(string login, string password)
- {
- _login = login;
- _password = password;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment