Beispiel #1
0
        private void btConnect_Click(object sender, EventArgs e)
        {
            RegistryKey currentUser     = Registry.CurrentUser;
            RegistryKey connectionLogin = currentUser.CreateSubKey("Connection");

            if (chbRimember.Checked)
            {
                connectionLogin.SetValue("Checked", "true");
                connectionLogin.SetValue("Login", tbLogin.Text);
                connectionLogin.SetValue("Password", tbPassword.Text);
                connectionLogin.Close();
            }
            else
            {
                connectionLogin.SetValue("Checked", "false");
            }

            OpenEnter();
            string table = conData.CheckAccount(tbLogin.Text, tbPassword.Text);

            FirstTable = table;

            if (table != "")
            {
                fmMain form = new fmMain();
                form.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Ошибка неверный пароль или логин!",
                                "Ошибка", MessageBoxButtons.OK);
            }
        }