实现关机代码:
System.Diagnostics. ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo("SHUTDOWN.EXE");
startInfo.Arguments = "-S -T 30";
System.Diagnostics.Process.Start(startInfo);
-S 是代表关机 -T是代表时间!
这和在开始-运行里 shutdows -s -t 30 效果一样
在任何情况下都可以实现关机的效果 还会弹出提示 30秒后关机
如果不想关机 可在运行框里输入:
shutdown -a
(XP/2003测试能过 谁装了Vista帮测试一下吧 呵呵)
System.Diagnostics. ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo("SHUTDOWN.EXE");
startInfo.Arguments = "-S -T 30";
System.Diagnostics.Process.Start(startInfo);
-S 是代表关机 -T是代表时间!
这和在开始-运行里 shutdows -s -t 30 效果一样
在任何情况下都可以实现关机的效果 还会弹出提示 30秒后关机
如果不想关机 可在运行框里输入:
shutdown -a
(XP/2003测试能过 谁装了Vista帮测试一下吧 呵呵)