Topic: How to add Save Password ?

Hi
Any one have solution how to add save password check box for login window ?


https://i.ibb.co/bP2xfCv/MVD-Save-Password.png

Life is like a school;
One can learn and graduate or stay behind.

2 (edited by brian.zaballa 2022-04-07 09:08:48)

Re: How to add Save Password ?

There's a bunch of codes here from my previous work on having a secret question and answer. I hope this can help you start on your problem.
If you find the code OnActivate

TForm(Form1).OnActivate := @activateForm;

somewhat new, you are not alone. I just learned and using it in the Project I am working with Embarcadero Delphi. Helps a lot on some circumstances.

Post's attachments

Attachment icon Remember.zip 557.32 kb, 251 downloads since 2022-04-07 

brian

Re: How to add Save Password ?

brian.zaballa wrote:

There's a bunch of codes here from my previous work on having a secret question and answer. I hope this can help you start on your problem.
If you find the code OnActivate

TForm(Form1).OnActivate := @activateForm;

somewhat new, you are not alone. I just learned and using it in the Project I am working with Embarcadero Delphi. Helps a lot on some circumstances.

Hi,
Thanks for your help, this is very complex code. can you shorting this code only for add Save Password checkbox ?

Life is like a school;
One can learn and graduate or stay behind.

Re: How to add Save Password ?

Here.

Post's attachments

Attachment icon Remember2.zip 551.1 kb, 259 downloads since 2022-04-07 

brian

Re: How to add Save Password ?

brian.zaballa wrote:

Here.

Too many thanks, this is a perfect

I have change the location of the remember check box by modifying lines 49 and 50 , I believe this issue appear due computer screen resolution.

chkRemember.Left := 140;
chkRemember.Top := 345;

https://i.ibb.co/8mwqvHc/MVD-Save-Password-Final.png

Life is like a school;
One can learn and graduate or stay behind.

6 (edited by brian.zaballa 2022-04-07 21:10:57)

Re: How to add Save Password ?

Try using bLogin as your reference

chkRemember.Left := frmdbCoreLogin.bLogin.Left;
chkRemember.Top := frmdbCoreLogin.bLogin.Top-30;
brian

7 (edited by FMR 2022-04-08 20:31:11)

Re: How to add Save Password ?

brian.zaballa wrote:

Try using bLogin as your reference

chkRemember.Left := frmdbCoreLogin.bLogin.Left;
chkRemember.Top := frmdbCoreLogin.bLogin.Top-30;

More than perfect !
The screenshot in attachment also I will try on others computers to check the results

Post's attachments

Attachment icon MVD_Save_Password (2).png 12.76 kb, 89 downloads since 2022-04-08 

Life is like a school;
One can learn and graduate or stay behind.

Re: How to add Save Password ?

Hi
I have a new issue, When I switch from SQLight to MySQL I facing issue on below lines

ini.WriteString('REMEMBER', 'user', EncryptRC5(frmdbCoreLogin.edLogin.Text, frmSafeguard.encryptKey.Caption));
ini.WriteString('REMEMBER', 'pass', EncryptRC5(frmdbCoreLogin.edPassword.Text, frmSafeguard.encryptKey.Caption));
frmdbCoreLogin.edLogin.Text := DecryptRC5(remUser, frmSafeguard.encryptKey.Caption);
frmdbCoreLogin.edPassword.Text := DecryptRC5(remPass, frmSafeguard.encryptKey.Caption);
Life is like a school;
One can learn and graduate or stay behind.

Re: How to add Save Password ?

That code doesn't affect to what DB you use. Is there any error message?
Check your user login settings too, maybe you are using dropdown instead of text

brian

10

Re: How to add Save Password ?

Hi
When I click Run the MVD stop and show to me red line, if I removed the red lines that I mentioned,  the project run but without saving the password

https://i.ibb.co/0CkhDSW/Error-Save-Password.png

Life is like a school;
One can learn and graduate or stay behind.

11 (edited by brian.zaballa 2022-04-09 07:28:48)

Re: How to add Save Password ?

Can you check on the error? You can see it below https://ibb.co/Y7yBrbh
Maybe you didn't have the frmSafeguard or the label in it. Check on the error.

Off topic, how can I use the image I mean to show it on my reply/post. LMAO, been a while here but I can't use that img.

brian

12

Re: How to add Save Password ?

brian.zaballa wrote:

Can you check on the error? You can see it below https://ibb.co/Y7yBrbh
Maybe you didn't have the frmSafeguard or the label in it. Check on the error.

Off topic, how can I use the image I mean to show it on my reply/post. LMAO, been a while here but I can't use that img.


Undeclared identifier: 'frmSafeguard' at 30:105
Life is like a school;
One can learn and graduate or stay behind.

Re: How to add Save Password ?

There you have it, maybe you don't have frmSafeguard on your project.

I just put the key there for some security purposes, you can override it

ini.WriteString('REMEMBER', 'user', EncryptRC5(frmdbCoreLogin.edLogin.Text, 'YourKey'));
ini.WriteString('REMEMBER', 'pass', EncryptRC5(frmdbCoreLogin.edPassword.Text, 'YourKey'));
frmdbCoreLogin.edLogin.Text := DecryptRC5(remUser, 'YourKey');
frmdbCoreLogin.edPassword.Text := DecryptRC5(remPass, 'YourKey');
brian

14

Re: How to add Save Password ?

brian.zaballa wrote:

There you have it, maybe you don't have frmSafeguard on your project.

I just put the key there for some security purposes, you can override it

ini.WriteString('REMEMBER', 'user', EncryptRC5(frmdbCoreLogin.edLogin.Text, 'YourKey'));
ini.WriteString('REMEMBER', 'pass', EncryptRC5(frmdbCoreLogin.edPassword.Text, 'YourKey'));
frmdbCoreLogin.edLogin.Text := DecryptRC5(remUser, 'YourKey');
frmdbCoreLogin.edPassword.Text := DecryptRC5(remPass, 'YourKey');

Your help is amazing
I'm really appreciate your help, THANK YOU

Life is like a school;
One can learn and graduate or stay behind.

15

Re: How to add Save Password ?

How to change the image for login screen ?

Life is like a school;
One can learn and graduate or stay behind.

Re: How to add Save Password ?

Hi FMR, Hi Brian,
Perhaps try it like this (see attached - UserID = admin, Password = admin).
Regards,
Derek

Post's attachments

Attachment icon login own image.zip 363.07 kb, 230 downloads since 2022-04-16 

17

Re: How to add Save Password ?

derek wrote:

Hi FMR, Hi Brian,
Perhaps try it like this (see attached - UserID = admin, Password = admin).
Regards,
Derek

Thank you Derek
It's work

Life is like a school;
One can learn and graduate or stay behind.

18

Re: How to add Save Password ?

Hello,

Sorry for bothering you again, but I facing a strange issue.

When I switch from SQLight to MySQL, the saving username and password will not working if I add a button or any object on From1. When I remove all objects on Form1 the saving password will working.
Please review my project in attachment

Post's attachments

Attachment icon Save Password for Login - MySQL.zip 9.21 kb, 183 downloads since 2022-04-20 

Life is like a school;
One can learn and graduate or stay behind.

Re: How to add Save Password ?

Here's a workaround, putting password saving function on the mousenter event of the Form1. It seems that the onActivate function runs right after the showing of the login form.

Post's attachments

Attachment icon Save Password for Login - MySQL_2.zip 552.83 kb, 212 downloads since 2022-04-20 

brian

20

Re: How to add Save Password ?

brian.zaballa wrote:

Here's a workaround, putting password saving function on the mousenter event of the Form1. It seems that the onActivate function runs right after the showing of the login form.

Brian , You are brilliant as usual !

I tried figure out what is problem by my self but when I tired, I ask in the right place and I got the perfect answer from you.

I'm really appreciate you much

Life is like a school;
One can learn and graduate or stay behind.