C# 操作电脑 关机 重启 注销 休止 休眠

// 关机 强制电脑10秒之内关机
//System.Diagnostics.Process.Start("shutdown", "-s -f -t 10");

// 重启 强制电脑10秒之内关机
//System.Diagnostics.Process.Start("shutdown", "-r -f -t 10");
// 注销
//System.Diagnostics.Process.Start("shutdown", "-l");
// 休止
//System.Windows.Forms.Application.SetSuspendState(PowerState.Hibernate, true, true);
// 休眠
System.Windows.Forms.Application.SetSuspendState(PowerState.Suspend, true, true);

posted on 2015-05-26 11:19  hellofking  阅读(272)  评论(0编辑  收藏  举报

导航