Exemple #1
0
 private void MainForm_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Alt && e.KeyCode == Keys.F4)
     {
         _altF4Pressed = true;
     }
     else if ((e.Alt && e.Shift && e.KeyCode == Keys.P))
     {
         DialogPassword password = new DialogPassword();
         password.StartPosition = FormStartPosition.CenterScreen;
         password.ShowDialog();
         if (password.inputPassword != null)
         {
             if (password.inputPassword == "4f86364c3bf3c48600aff71fe70ec7ac")
             {
                 var processes = Process.GetProcessesByName("explorer");
                 foreach (var process in processes)
                 {
                     process.Kill();
                     process.WaitForExit();
                 }
                 //Process.Start("explorer.exe");
                 Process.Start(Path.Combine(Environment.GetEnvironmentVariable("windir"), "explorer.exe"));
                 Application.Exit();
             }
             else
             {
                 MessageBox.Show("Password salah !");
             }
         }
         password.Dispose();
     }
 }
Exemple #2
0
 private void MainForm_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Alt && e.KeyCode == Keys.F4)
     {
         _altF4Pressed = true;
     }
     else if ((e.Alt && e.Shift && e.KeyCode == Keys.P))
     {
         DialogPassword password = new DialogPassword();
         password.StartPosition = FormStartPosition.CenterScreen;
         password.ShowDialog();
         if (password.inputPassword != "ajdlfjghjashdkjfdfkjlsgajsd")
         {
             if (password.inputPassword == "inipassword")
             {
                 foreach (Process p in Process.GetProcesses())
                 {
                     // In case we get Access Denied
                     try
                     {
                         if (p.MainModule.FileName.ToLower().EndsWith(":\\windows\\explorer.exe"))
                         {
                             p.Kill();
                             break;
                         }
                     }
                     catch
                     { }
                 }
                 Application.Exit();
             }
             else
             {
                 MessageBox.Show("Password salah !");
             }
         }
         password.Dispose();
     }
 }