コード例 #1
0
        private void btnLog_Click(object sender, EventArgs e)
        {
            LOGIN login = new LOGIN();

            login.Show();
            this.Close();
        }
コード例 #2
0
        //inserts tiemout session
        private void label28_Click(object sender, EventArgs e)
        {
            string          getSession;
            string          myConn   = "Server=127.0.0.1;Database=munchlab;Uid=root;Pwd=root;";
            MySqlConnection Conn     = new MySqlConnection(myConn);
            MySqlCommand    insertTO = new MySqlCommand();

            insertTO.Connection  = Conn;
            insertTO.CommandText = "select max(getSession) from loginhistory";
            Conn.Open();
            getSession = insertTO.ExecuteScalar().ToString();

            insertTO.CommandText = "update loginhistory set timeout=@timeout where getSession=@getSession";
            insertTO.Parameters.AddWithValue("@timeout", DateTime.Now.ToShortTimeString());
            insertTO.Parameters.AddWithValue("@getSession", Convert.ToInt32(getSession));
            insertTO.ExecuteNonQuery();

            this.Hide();
            LOGIN ad = new LOGIN();

            ad.ShowDialog();
        }