zl程序教程

您现在的位置是:首页 >  硬件

当前栏目

将计算机设置为休眠状态

计算机 设置
2023-09-14 09:00:20 时间

实现效果:

  

知识运用:

  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);
        }