将计算机设置为休眠状态

实现效果:

  

知识运用:

  Application类的SetSuspendState方法     //挂起系统或使系统休眠

  public static bool SetSuspendState (PowerState state ,bool force , bool  disableWakeEvent)

  

实现代码:

        private void button1_Click(object sender, EventArgs e)
        {
            Application.SetSuspendState(PowerState.Hibernate,true,false);
        }
原文地址:https://www.cnblogs.com/feiyucha/p/10302323.html