C# 从C休眠计算机#
我想通过点击C#Windows窗体应用程序中的按钮来休眠我的计算机C# 从C休眠计算机#,c#,windows,winforms,C#,Windows,Winforms,我想通过点击C#Windows窗体应用程序中的按钮来休眠我的计算机 private void Button1_Click(object sender, EventArgs e) { //Hibernate the computer } 有关更多信息,请参阅方法 你可以这样称呼它 Application.SetSuspendState(PowerState.Hibernate, true, true) 使用方法: 或: private void button1_Click(object
private void Button1_Click(object sender, EventArgs e)
{
//Hibernate the computer
}
有关更多信息,请参阅方法
你可以这样称呼它
Application.SetSuspendState(PowerState.Hibernate, true, true)
使用方法:
或:
private void button1_Click(object sender, EventArgs e)
{
Application.SetSuspendState(PowerState.Hibernate, true, true);
}
using System.Diagnostics;
Process.Start("shutdown", "/h /f");