wifi+定时关机1.0
2016-12-30 23:04
106 查看
#include "cv.h" #include "highgui.h" #include <iostream> #include "windows.h" #include <iostream> #include <string> #include <sstream> #include <stdlib.h> using namespace std; void print() { system( "mode con cols=59 lines=25" );//窗口宽度高度 system( "color 8f" ); //SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_GREEN); //printf("Hello"); system( "CLS" ); system( "title All Copyright Reserved by Author of ims" );//设置cmd窗口标题 cout << " ╔══════════════════════════╗\n" << " ║ 按序号执行任务 ║\n" << " ║══════════════════════════║\n" << " ║ WIFI ║ 关机 ║\n" << " ║ 1.启用无线网络 ║ 11.延时关机(单位分钟)║\n" << " ║ 2.停止无线网络 ║ 12.取消延时关机任务 ║\n" << " ║ 3.显示连接用户 ║ 13.定时关机 ║\n" << " ║ 4.显示WiFi密码 ║ 14.取消延时关机任务 ║\n" << " ║ 5.修改WiFi名称 ║ 15.查看计划 ║\n" << " ║ 6.修改WiFi密码 ║ 16.退出 ║\n" << " ║ 7.首次使用初始化 ║ 17.使用说明 ║\n" << " ║══════════════════════════║\n" << " ║ 10.启用摄像头 ║\n" << " ╚══════════════════════════╝\n"; } int main() { print(); string c; cout<<"输入任务序号:"; cin >> c; while( c != "0" ) { while( c == "10" ) { cvNamedWindow("Camera"); CvCapture* capture = cvCreateCameraCapture(0); //创建并获取摄像设备 IplImage* frame; while(1) { frame = cvQueryFrame(capture); //创建并获取一张摄像截图 if(!frame) break; //如果失败终止循环 cvShowImage("Camera", frame); //在一个"win"窗口,并当中显示该截图 int c = cvWaitKey(15);//等待50ms if(c>0) //对应esc键值 break; } cvReleaseCapture(&capture); //释放摄像设备 cvDestroyWindow("Camera"); //释放窗口"win" goto loop; } loop: while( c == "11" ) { string down="shutdown -s -t "; int t; cout<<"输入延时关机时间:"; cin>>t; stringstream s; s<<t; t*=60; stringstream ss; ss<<t; string input; ss>>input; down+=input; const char *shut=down.c_str(); //cout<<shut<<endl; system(shut); string out="分钟后关机。 "; string s1; s>>s1; s1+=out; cout<<s1<<endl; cout<<endl; break; } while( c == "12" ) { system( "shutdown -a" ); cout<<"关机任务已经取消。"<<endl; break; } while( c == "13" ) { stringstream ss1,ss2; string down="at "; string str=" shutdown -s -t 10"; int t1,t2; string st1,st2; cout<<"输入定时关机时间:"; cin>>t1; cin>>t2; if(t1>23||t1<0||t2<0||t2>59) { cout<<"输入正确的24小时制的时间,时与分之间用空格分割。"<<endl; continue; } ss1<<t1; ss1>>st1; ss2<<t2; ss2>>st2; down+=st1; down+=":"; down+=st2; down+=str; const char *shut=down.c_str(); //cout<<shut<<endl; system(shut); break; //system( "time" ); } while( c == "14" ) { system( "at /delete" ); break; } while( c == "15" ) { system( "at" ); break; } while( c == "16" ) { return 0; } while( c == "1" ) { system( "netsh wlan start hostednetwork" ); break; } while( c == "2" ) { system( "netsh wlan stop hostednetwork" ); break; } while( c == "3" ) { system( "netsh wlan show hostednetwork" ); break; } while( c == "4" ) { system( "netsh wlan show hostednetwork security" ); break; } while( c == "5" ) { string str="netsh wlan set hostednetwork ssid= "; string str1; cout<<"输入新wifi名:"; cin>>str1; str+=str1; const char *cmd=str.c_str(); system(cmd ); break; } while( c == "6" ) { string str="netsh wlan set hostednetwork key= "; string str1; cout<<"输入新密码:"; cin>>str1; str+=str1; const char *cmd=str.c_str(); system( cmd ); break; } while( c == "7" ) { system( "netsh wlan set hostednetwork mode=allow ssid=default_wifi key=12345678" ); break; } while( c == "17" ) { cout<<"wifi:首次使用时,把本地连接设置为共享。"; break; } cout<<endl; cout<<"输入任务序号:"; cin >> c; } return 0; }
相关文章推荐
- 小精灵定时关机 v1.0 绿色
- 电脑设置每天定时关机
- 给Mac设置定时关机、重启、睡眠
- Windows 2000、Windows XP 和 Windows 2003 Server定时开机与关机设置
- 定时开机、关机并自动登录操作系统
- 几个关机、重启NT系统的脚本(如何定时或系统无相应一段时间后执行关机任务)
- 批处理脚本之定时关机
- Linux-CenOS 定时关机
- 用hta[javascript]写的定时重启或关机的小工具
- 微软提升关机速度程序 v1.0 官方
- 苹果系统定时关机(MacOS 定时关机)
- 定时关机
- 系统定时自动开、关机
- BIOS定时开机 ,关机的八个方法
- 大学作品回顾--网络定时关机
- WINXP/2000/2003系统定时关机小程序
- 入门dos,哈哈,发一个定时关机
- windows 定时任务 - 定时关机
- win10 设置定时关机
- 自动定时开机 自动定时 关机