
2个回答
展开全部
//重启计算机代码
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;” 睡眠和休眠的偶还不会呵呵呵~
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
);
CallNtPowerInformation
NTSTATUS WINAPI CallNtPowerInformation(
__in POWER_INFORMATION_LEVEL InformationLevel,
__in PVOID lpInputBuffer,
__in ULONG nInputBufferSize,
__out PVOID lpOutputBuffer,
__in ULONG nOutputBufferSize
);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询