- #1
ExplosiveMercury
- 8
- 0
Hi, I've been recently started programming, and wanted to make program I can use in everyday life. I use CMD hosted network every day on my other PC, and wanted to make program in witch I can stop/start/restart hosted network.
This is current progress:
The thing is, when I input stop, start or restart, no text appears on the screen. Can somebody explain it to me and correct my script. Thanks!
This is current progress:
Code:
#include <iostream>
int main () {
using namespace std;
string start;
string stop;
string restart = stop + start;
string answer;
cout << "\n\n Hosted Network Control \n\n" << endl;
cout << "\nStop Hosted Network\n" << endl << "\nStart Hosted Network\n" << endl << "\nRestart Hosted Network\n" << endl;
cin >> answer;
if (answer == start)
{
cout << "\n Hosted Network Has Been Started. \n" << endl;
system("netsh wlan start hostednetwork");
system("pause>nul");
}
if (answer == stop)
{
cout << "\n Hosted Network Has Been Stopped. \n" << endl;
system("netsh wlan stop hostednetwork");
system ("pause>nul");
}
if (answer == restart)
{
system("netsh wlan stop hostednetwork");
system("netsh wlan start hostednetwork");
cout << "\n Hosted Network Has Been Restarted. \n" << endl;
system("pause>nul");
}
system("pause");
return 0;
}
The thing is, when I input stop, start or restart, no text appears on the screen. Can somebody explain it to me and correct my script. Thanks!
Last edited by a moderator: