Question

I am making login system ,

I succeeded all the way but ,i want a bit more professional ,in my login system ,when user enters password in his password edit box ,i want to convert them as ***** but i want real data what they types to test their authentication and i want to make save this account ,how can i do that

example

alt text

Was it helpful?

Solution

Set your edit box's PasswordChar property to *.

This will make it display only asterisks, but the real text is still available to you in the Text property.

OTHER TIPS

Following up your comments in Blorgbeard's accepted answer (really you should edit your question);

1) If all you want to do is to remember the user's username from the last time they logged in, store something in the 'Current User' part of the registry. About Delphi - storing things in the registry etc and More about storing in the registry might help.

2) If you want to simulate passwordchar in another kind of editbox, then you're probably going to need to hook into the keypress event. You'll want to have some form-variable to store the 'real' password as it's being accumulated by keypresses, and you'll want to change the keypress char to a '*' (or whatever) once you've captured the keypress but before the char goes to the edit box.

I would imagine that either the form keypreview or just the keyup/keydown events would help you get that. You're going to need to watch out for backspace/delete, or the user doing a copy/paste into the edit box.

I suspect there are enough 'edge cases' with this to drive you to distraction - are you sure there's no password masking mechanism in your component?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top