Hola!!
Aqui te pongo el código en C#:
Código:
using System;
using System.Diagnostics;
using System.ComponentModel;
namespace ShutPc
{
class PowerOff
{
[STAThread]
static void Main(string[] args)
{
//try to shut down windows use shell "shutdown.exe -s" (shutdown) shell
"shutown.exe -r" (reboot)
Process.Start("shutdown.exe","-s" );
//shell
}
}
}
Espero que te sirva!!
Saludos!!!!