예제 #1
0
        private void EntrarB_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(clavetxt.Text) == true || string.IsNullOrWhiteSpace(conftxt.Text) == true)
            {
                MessageBox.Show("No se permiten campos vacios");
            }
            else
            {
                users us = new users();
                //users us = new users();
                string login_pass = clavetxt.Text;
                MD5    md5        = MD5.Create();
                byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(login_pass);
                byte[] hash       = md5.ComputeHash(inputBytes);
                login_pass = BitConverter.ToString(hash).Replace("-", "");

                int clave;

                clave = Int32.Parse(textBox1.Text);

                if (clavetxt.Text == conftxt.Text)
                {
                    MessageBox.Show(us.Cambiarcontra(login_pass, clave));
                    MenuPrincipal forma2 = new MenuPrincipal();
                    forma2.Show();
                    this.Hide();
                }
            }
        }