private void button2_Click(object sender, EventArgs e) { try { con.Open(); com.CommandText = @"SELECT * FROM Conturi WHERE Username='******'"; com.CommandType = System.Data.CommandType.Text; OleDbDataReader reader = com.ExecuteReader(); while (reader.Read()) { user = reader.GetString(1); pass = reader.GetString(2); score = reader["score"].ToString(); //MessageBox.Show("'"+score+"'"); } if (user == textBox1.Text && pass == textBox2.Text) { Te_crezi_IT_ist fo = new Te_crezi_IT_ist(); StreamWriter sw = new StreamWriter("C:\\book\\Util\\log.txt"); sw.WriteLine(textBox1.Text); sw.WriteLine(score); sw.Close(); fo.Show(); this.Hide(); } } catch (Exception ex) { MessageBox.Show("Utilizatorul nu a fost gasit sau ati gresit parola ", "Eroare"); } }
private void button1_Click(object sender, EventArgs e) { this.Hide(); Te_crezi_IT_ist t = new Te_crezi_IT_ist(); t.Show(); }