jjzjj

StartShutDown

全部标签

c# - 从 .NET 应用程序中重新启动 Windows

如何使用.NET框架重新启动或关闭Windows? 最佳答案 以下代码将从shell执行关机命令://usingSystem.Diagnostics;classShutdown{//////Windowsrestart///publicstaticvoidRestart(){StartShutDown("-f-r-t5");}//////Logoff.///publicstaticvoidLogOff(){StartShutDown("-l");}//////ShuttingDownWindows///publicstaticvoi