I need to be able to mask string inputs. That is, when you enter a password, an asterisk (****) appears instead of the actual character. Is this possible? If so, how?
Thanks
Printable View
I need to be able to mask string inputs. That is, when you enter a password, an asterisk (****) appears instead of the actual character. Is this possible? If so, how?
Thanks
You'll have to find some system dependant method of getting input that doesn't echo itself on the screen. getch() in conio.h does this on most compilers.
Then every time you read an input, output an asterisk. You'll have to handle things like backspaces yourself aswell.
maby something like this?
void __fastcall TForm1::Button1Click(TObject * Sender)
{
AnsiString String1 = Edit1->Text;
AnsiString String2 = "enter";
int i = CompareStr (String1, String2);
if (i != 0)
{
Showmessage ("password incorrect");
}
else
ShowMessage ("password correct");
}
--------------------------------------------------
sorry if this didn't help, anywayz in a c++ builder you can
modefy this aspect in the Object inspector under Property's.