private void frmMain_FormClosing(object sender, FormClosingEventArgs e) { if (frmMain.ModifierKeys == Keys.Alt || frmMain.ModifierKeys == Keys.F4) { e.Cancel = true; return; } // chạy lần nữa để đóng pd.run_bat_file(); Thread.Sleep(200); pd.delete_bat_file(); }
private void Login_FormClosing(object sender, FormClosingEventArgs e) { protectDatabase pd = new protectDatabase("1", "1"); pd.delete_bat_file(); }