Ok I have a Q related to the password problem I reported earlier.
I am using the same program but I want it to shutdown the computer if the password is wrong. Is there any way I can do this? I can make a shortcut that restarts the computer by making a new shortcut and pasteing this in the command line C:\windows\rundll.exe user.exe,exitwindowsexec . I wonder if I could somehow incorporate this into my password program. I can make the program run on startup, therefore creating a blockade, to say, keep youger siblings off when you don't want them in your room while you are trying to do something...
My code...
#include <iostream.h>
#include <string.h>
int main()
{
char *t=new char[20];
char *x=new char[20];
x="trey";
cout<<"Enter password, please: ";
cin.getline(t, 20, '\n');
if (!strcmp(t, x))
{
cin.get();
}
else
{
cin.get();
//This is where I want the shutdown to be...
}
return 0;
}