Пример #1
0
        private void label1_Click(object sender, EventArgs e)
        {
            Form MW = new MainWindows("Мини-Хацкер!", "a");

            MW.Show();
            this.Hide();
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string User_Login, UserEmail, User_Password = textBox2.Text;

            if (textBox1.Text.IndexOf('@') == -1)
            {
                User_Login = textBox1.Text;
                UserEmail  = "";
            }
            else
            {
                UserEmail  = textBox1.Text;
                User_Login = "";
            }
            StreamReader sr   = new StreamReader("users/UserInfo.txt");
            bool         Aser = false;

            while (!sr.EndOfStream)
            {
                string[] info = sr.ReadLine().Split(',');
                if ((info[0] == User_Login && info[1] == User_Password) ||
                    (info[2] == UserEmail && info[1] == User_Password))
                {
                    if (info[4] == "False")
                    {
                        Aser = true;
                        MessageBox.Show("Вы успешно авторизовались",
                                        "Успешный вход", MessageBoxButtons.OK,
                                        MessageBoxIcon.Information);
                        Form MW = new MainWindows(info[0], info[3]);
                        MW.Show();
                        this.Hide();
                        break;
                    }
                    else
                    {
                        Aser = true;
                        MessageBox.Show("Извините, но Ваша учетная запись была забанена Администрацией" +
                                        "Заблокированно", "Авторизация невозможна", MessageBoxButtons.OK,
                                        MessageBoxIcon.Information);
                        break;
                    }
                }
            }
            sr.Close();
            if (!Aser)
            {
                MessageBox.Show("Неверный логин/email или пароль",
                                "Ошибка входа", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
        }