// wire.cpp : 定義控制檯應用程序的入口點。 // #include <iostream> #include <string.h> using namespace std; int main() { for (;;) { cout << "1開啓無線,2從新設置無線,3關閉無線:"; int n; cin >> n; if (n == 1) system("netsh wlan start hostednetwork"); else if (n == 2) { char destination[100] = "netsh wlan set hostednetwork mode=allow ssid= "; char ssid[100], key[100], keyh[100] = " key=", *k = " "; cout << "請輸入無線名字:"; cin >> ssid; cout << endl; cout << "請輸入無線密碼:"; cin >> key; cout << endl; strcat(destination, ssid); strcat(destination, keyh); strcat(destination, key); system(destination); system("netsh wlan start hostednetwork"); } else system("netsh wlan stop hostednetwork"); } return 0; }