The simplest way would be something like this:
System.Diagnostics.Process.Start("shutdown", "/s /t 240");
Forcing closing of currently running applications without asking can be done using the option "-f".
For exact command line parameters, run "shutdown" on your system and see how it use its help, following the instructions. You can also see this:
http://technet.microsoft.com/en-us/library/bb491003.aspx[
^].
You can also use Windows API or
System.Management
(WMI), according to the answers to this question:
http://stackoverflow.com/questions/102567/how-to-shutdown-the-computer-from-c-sharp[
^].
—SA