浏览代码

Update Utilities.cs

deadmoon 3 年之前
父节点
当前提交
718d3fd19c
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      Optimizer/Utilities.cs

+ 12 - 0
Optimizer/Utilities.cs

@@ -242,6 +242,18 @@ namespace Optimizer
             Utilities.RunCommand("shutdown /r /t 0");
         }
 
+        internal static void DisableHibernation()
+        {
+            Utilities.RunCommand("powercfg -h off");
+            Utilities.RunCommand("powercfg -h off");
+        }
+
+        internal static void EnableHibernation()
+        {
+            Utilities.RunCommand("powercfg -h on");
+            Utilities.RunCommand("powercfg -h on");
+        }
+
         internal static void ActivateMainForm()
         {
             Program._MainForm.Activate();