//重启计算机代码 ProcessStartInfo ps = new ProcessStartInfo(); ps.FileName = "shutdown.exe"; ps.Arguments = "-r -t 0"; Process.Start(ps);//注销计算机代码 ProcessStartInfo ps = new ProcessStartInfo(); ps.FileName = "shutdown.exe"; ps.Arguments = "-l"; Process.Start(ps);//关闭计算机代码: ProcessStartInfo ps = new ProcessStartInfo(); ps.FileName = "shutdown.exe"; ps.Arguments = "-s -t 0"; Process.Start(ps);备注:在用“ProcessStartInfo ”方法之前需要引入命名空间“using System.Diagnostics;” 睡眠和休眠的偶还不会呵呵呵~
百度一下windows 电源管理 api 你会有结论CallNtPowerInformation NTSTATUS WINAPI CallNtPowerInformation( __in POWER_INFORMATION_LEVEL InformationLevel, __in PVOID lpInputBuffer, __in ULONG nInputBufferSize, __out PVOID lpOutputBuffer, __in ULONG nOutputBufferSize);