C#实现系统关机、重启、注销等操作
2015-05-28 17:25
671 查看
//SHUT DOWN protected void btnShutDown_Click(object sender, EventArgs e) { Process.Start("shutdown.exe", "-s"); // By Default the Shutdown will take place after 30 Seconds //if you want to change the Delay try this one Process.Start("shutdown.exe","-s -t xx"); //Replace xx with Seconds example 10,20 etc } //RESTART protected void btnRestart_Click(object sender, EventArgs e) { Process.Start("shutdown.exe", "-r"); // By Default the Restart will take place after 30 Seconds //if you want to change the Delay try this one Process.Start("shutdown.exe","-r -t 10"); //Replace xx with Seconds example 10,20 etc } // LOG OFF protected void btnLogOff_Click(object sender, EventArgs e) { Process.Start("shutdown.exe", "-l"); //This Code Will Directly Log Off the System Without warnings }
相关文章推荐
- C# 实现关机 重启 注销等操作
- C# 实现系统关机、注销、重启、休眠、挂起
- C# 实现系统关机、注销、重启、休眠、挂起
- c# 中 控制电脑的 待机 关机 注销 重启 等操作的实现
- C#利用Windows API 实现关机、注销、重启等操作
- 在c#中怎么调用ExitWindowsEx函数实现XP的关机、注销、重启操作?
- C# 实现系统关机、注销、重启、休眠、挂起
- C#利用Windows API 实现关机、注销、重启等操作
- C#实现控制Windows系统关机、重启和注销的方法
- C#实现控制Windows系统关机、重启和注销的方法:
- C# 实现系统关机、注销、重启、休眠、挂起
- C# 代码如何实现让你的电脑关机,重启,注销,锁定,休眠,睡眠
- 用 C# 代码如何实现让你的电脑关机,重启,注销,锁定,休眠,睡眠
- C# 操作电脑 关机 重启 注销 休止 休眠
- C#实现注销、重启和关机代码
- C#实现关机重启及注销实例代码
- C++ 实现系统注销,重启,关机的方法
- C#实现注销、重启和关机代码
- C++ 实现系统注销,重启,关机的方法
- C# 调用系统关机、重启、注销的类