定时关机c++源码
2013-04-09 16:01
197 查看
#include <cstdlib> #include <iostream> using namespace std; int main() { int i; cout<<"1、关机"<<endl <<"2、重启"<<endl <<"3、注销"<<endl <<"4、休眠"<<endl <<"5、取消"<<endl; cin>>i; switch(i) { case 1:{ int j; cout<<"1、关机"<<endl <<"2、定时关机"<<endl <<"3、取消定时关机"<<endl <<"4、取消"<<endl; cin>>j; switch(j) { case 1: system("shutdown -s -t 0"); break; case 2:{ int t; cout<<"1、30分钟后关机"<<endl <<"2、60分钟后关机"<<endl <<"3、90分钟后关机"<<endl <<"4、120分钟后关机"<<endl <<"5、取消"<<endl; cin>>t; switch(t) { case 1: system("shutdown -s -t 1800"); break; case 2: system("shutdown -s -t 3600"); break; case 3: system("shutdown -s -t 5400"); break; case 4: system("shutdown -s -t 7200"); break; case 5: return 0; default: return 0; } break; } case 3: system("shutdown -a"); break; case 4: return 0; default: return 0; } break; } case 2: system("shutdown -r"); break; case 3: system("shutdown -l"); break; case 4: system("shutdown -h"); break; case 5: return 0; default: return 0; } return 0; }
相关文章推荐
- C#定时关机,重启,睡眠——界面
- Python利用多线程定时执行cmd命令关机
- 使用VBS实现电脑定时 关机 重启
- Windows 2003 Server 定时关机
- 定时关机
- 轻松实现Windows定时关机,何必麻烦第三方软件
- win10 设置定时关机
- Mac定时关机、重启、休眠命令行
- 定时开/关机[转]
- 批处理Bat实现整合定时关机或取消定时关机
- android 定时关机需root权限
- paip. 定时 关机 休眠 的总结
- 如何实现ubuntu每天定时关机
- win7 定时关机
- windows定时关机
- Windows 2000、Windows XP 和 Windows 2003 Server定时开机与关机设置
- 多种电脑定时关机方法教您怎么定时关机
- windos设置定时关机
- 定时断网与关机的小工具程序
- 系统定时关机的方法