Exemplo n.º 1
0
 private void biologie_Click(object sender, EventArgs e)
 {
     DECIZIE = "bio";
     Debug.WriteLine(DECIZIE);
     Login lg = new Login();
     this.Hide();
     lg.Show();
 }
Exemplo n.º 2
0
 private void matematica_Click_1(object sender, EventArgs e)
 {
     DECIZIE = "mate";
     Debug.WriteLine(DECIZIE);
     Login lg = new Login();
     this.Hide();
     lg.Show();
 }
Exemplo n.º 3
0
 private void pictureBox2_Click(object sender, EventArgs e)
 {
     if (nume.Text == "" || prenume.Text == "" || repass.Text == "" || password.Text == "" || username.Text == "")
         MessageBox.Show("Trebuie sa completati toate campurile!");
     else
         if (cross.Visible == true)
             MessageBox.Show("Parolele nu corespund!");
         else
         {
             string parola_criptata;
             parola_criptata = RC4Class.RC4_Class.RC4(password.Text, "38577af7-379f-421d-ad29-cd1994521704");
             SQLiteConnection sqlite_conn;
             SQLiteCommand sqlite_cmd;
             FileStream fstream;
             sqlite_conn = new SQLiteConnection("Data Source=LOGIN.db;Version=3;New=False;Compress=True;");
             try
             {
                 sqlite_conn.Open();
                 byte[] imageBt = null;
                 fstream = new FileStream(this.image_path.Text, FileMode.Open, FileAccess.Read);
                 BinaryReader br = new BinaryReader(fstream);
                 imageBt = br.ReadBytes((int)fstream.Length);
                 sqlite_cmd = sqlite_conn.CreateCommand();
                 sqlite_cmd.CommandText = "INSERT INTO utilizatori(nume, prenume, username, password,avatar) " +
                                                             "Values('" + nume.Text + "', '" + prenume.Text + "', '" + username.Text + "', '" + parola_criptata + "', @IMG);";
                 SQLiteParameter parameter = new SQLiteParameter("@IMG", System.Data.DbType.Binary);
                 SQLiteParameter parameter1 = new SQLiteParameter("@nume", System.Data.DbType.String);
                 SQLiteParameter parameter2 = new SQLiteParameter("@prenume", System.Data.DbType.String);
                 SQLiteParameter parameter3 = new SQLiteParameter("@username", System.Data.DbType.String);
                 SQLiteParameter parameter4 = new SQLiteParameter("@parola", System.Data.DbType.String);
                 parameter.Value = imageBt;
                 parameter1.Value = nume.Text;
                 parameter2.Value = prenume.Text;
                 parameter3.Value = username.Text;
                 parameter4.Value = parola_criptata;
                 sqlite_cmd.Parameters.Add(parameter);
                 sqlite_cmd.Parameters.Add(parameter1);
                 sqlite_cmd.Parameters.Add(parameter2);
                 sqlite_cmd.Parameters.Add(parameter3);
                 sqlite_cmd.Parameters.Add(parameter4);
                 sqlite_cmd.ExecuteNonQuery();
                 sqlite_conn.Close();
                 MessageBox.Show("Tocmai te-ai inscris in baza noastra de date!");
                 Login lg = new Login();
                 this.Hide();
                 lg.Show();
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message);
             }
         }
 }
Exemplo n.º 4
0
 private void pictureBox4_Click(object sender, EventArgs e)
 {
     Login lg = new Login();
     this.Hide();
     lg.Show();
 }