关闭Windows时不显示警告框?

时间:2012-08-15 18:21:16

标签: c# windows c#-4.0 windows-7 process

当我打电话时:

Process.Start("shutdown", "/s /t 60");

将出现一个警告消息框,其中包含“您的计算机将在1分钟内关闭”等消息。如何防止出现?还有另一种关闭窗口的方法吗?

2 个答案:

答案 0 :(得分:2)

你可以写:

Process.Start("shutdown", "/p");

答案 1 :(得分:1)

尝试:

  Process.Start("shutdown", "-f -t 0");
相关问题