Reboot machine from a C#/WPF app
问题 I want to have a button in my WPF app that restarts the machine. This app is always running on Vista. The fact that a quick search hasn't turned anything up makes me think this might be harder than I wish it was... any ideas? Thanks! 回答1: Try this: System.Diagnostics.Process.Start("shutdown.exe", "-r -t 0"); This starts Windows' inbuilt shutdown tool, which can also shut down or logoff a remote or the local machine. Here is the list of full options from ss64.com: Syntax SHUTDOWN [logoff