Example #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            MySqlConnection cn = AbrirConexao();

            cn.Open();
            MySqlCommand cmd = new MySqlCommand();

            cmd.Connection  = cn;
            cmd.CommandText = "Select *from usuarios where login= '******' and senha= '" + senha.Text + "'";

            MySqlDataReader reader = cmd.ExecuteReader();
            int             count  = 0;

            while (reader.Read())
            {
                count = count + 1;
            }
            if (count == 1)
            {
                Formularios.Menu menu = new Formularios.Menu();
                menu.ShowDialog();
                this.Visible = false;
            }
            else
            {
                MessageBox.Show("Usuario ou senha incorretos!");
            }

            cn.Close();
        }
Example #2
0
        public void timer1_Tick(object sender, EventArgs e)
        {
            if (progressBar1.Value < 100)
            {
                progressBar1.Value = progressBar1.Value + 2;
            }
            else
            {
                timer1.Enabled = false;
                Dispose();

                Formularios.Menu _menu = new Formularios.Menu();
                _menu.Show();
            }
        }