Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                conn.Open();
                adapter = new MySqlCommand("SELECT * FROM Main WHERE username='******' AND password='******'", conn);

                using (MySqlDataReader reader = adapter.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        // save to a xml file also need to work on logout script witch will replace the login varable instead of the UID of the user but with Null
                        // so the script won't allow access

                        XMLMaker mw = new XMLMaker();
                        mw.MyWriter(reader["UID"].ToString());
                        MessageBox.Show(reader.Read().ToString());
                        MessageBox.Show("");
                        MessageBox.Show("OK entered");
                        MessageBox.Show(reader["UID"].ToString());
                        Form2 f2 = new Form2();
                        f2.Show();
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                // should b nothing for now
                MessageBox.Show("password or username incorrect " + ex);
            }
            finally
            {
                conn.Close();
            }
        }
Example #2
0
 private void toolStripStatusLabel1_Click(object sender, EventArgs e)
 {
     mw.MyWriter("Here"); mw.MyReadr();
 }