Example #1
0
 public static void Hibernate()
 {
     Task.Factory.StartNew(() =>
     {
         if (PowerStatusBox.PowerAction("Hibernate", 10))
         {
             SetSuspendState(true, true, true);
         }
     });
 }
Example #2
0
 public static void Shutdown()
 {
     Task.Factory.StartNew(() =>
     {
         if (PowerStatusBox.PowerAction("Shut Down", 10))
         {
             ProcessStartInfo si = new ProcessStartInfo("shutdown", "/s /t 0");
             si.CreateNoWindow   = true;
             si.WindowStyle      = ProcessWindowStyle.Hidden;
             Process.Start(si);
         }
     });
 }