hello any one please help me quickly. Because i never forget ur timely help.
Iam having a c++ program with password function. The password function is working properly and password is taken in ***** sign.
my coding for password is
do{
cout << "\t\tEnter Username : "; //asking to enter username
cin>>User;
cout << "\t\tEnter Password : "; //asking to enter password
while(ch != '\r') //Loop until 'Enter' is pressed
{
ch = getch();
if(ch == '0')
{
switch(getch())
{
default:
break;
};
}
else if(ch == '\b') //If the 'Backspace' key is pressed
{
if(password.size() != 0) //If the password string contains data, erase last character
{
cout << "\b \b";
password.erase(password.size() - 1, 1);
}
continue;
}
else if(ch <= '9' && ch >= '0' || ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z') //If user enters 1-9, a-z, or A-Z, add it to the password and display an asterisk
{
password += ch;
cout << "*";
}
else
continue;
}
while(User!=secname && password!=secid);
iam using this inside a do while loop to repeat the password require function.
When user login to the system and enter password for the first time system takes the password and username even if input is a wrong username or password. Then again he asked to enter user name and taken but not take the password... enter password is just printed but not taking.