如何睡眠10台设备 [英] How to sleep windows 10 device

查看:88
本文介绍了如何睡眠10台设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 

我需要将我的Windows 10设备置于睡眠模式。目前我正在使用以下代码执行此操作 -

I need to do my windows 10 device into sleep mode. Currently I am doing this by using below code-

  string filename =" Rundll32.exe";

  string filename = "Rundll32.exe";

  string arguments =" powrprof.dll,SetSuspendState 0,1,1";

  string arguments = "powrprof.dll, SetSuspendState 0,1,1";

实际上我需要在通过调度程序睡眠几个小时后唤醒这个系统,但不会醒来。

Actually I need to wake up this system after few hours after sleeping through scheduler, but not waking up.

但是如果我手动睡觉它会通过调度程序按时唤醒系统。

BUT if I sleep it manually it wakes up the system on time through scheduler.

所以我想知道手动睡眠时运行的代码。需要使用相同的代码而不是上面的代码。

So I want to know the code which runs on manually sleep. Need to use same code instead of above.

sandeep chauhan

sandeep chauhan

推荐答案

根据  https://docs.microsoft.com/zh-cn/windows/desktop/api/powrprof/nf-powrprof-setsuspendstate 。并注意第三个 参数
的  SetSuspendState()。 

According to https://docs.microsoft.com/zh-cn/windows/desktop/api/powrprof/nf-powrprof-setsuspendstate. And pay attention to The third parameter of SetSuspendState(). 


  • 如果此参数是  TRUE
    系统禁用所有唤醒事件。如果参数是 
    FALSE
    任何系统唤醒事件都保持启用状态。
  • If this parameter is TRUE, the system disables all wake events. If the parameter is FALSE, any system wake events remain enabled.

您已将其设置为true并禁用所有唤醒事件。

You have set it to true and disables all wake events.


祝你好运,

Best regards,


Drake

Drake


这篇关于如何睡眠10台设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆