Topic: passcode

How can when I press the delete key it asks for the passcode to confirm the deletion?

Post's attachments

Attachment icon delet pass.rar 294.12 kb, 50 downloads since 2024-02-15 

Re: passcode

ms2014m wrote:

How can when I press the delete key it asks for the passcode to confirm the deletion?

procedure Form1_Button2_OnClick (Sender: TObject; var Cancel: boolean);
var
 pass : string = '1234jkjh';
 inputPass : string;
begin
  InputQuery('Подтверждение удаления ','Для удаления записи введите пароль',inputPass);
  if (inputPass <> pass) then Cancel := True;
end;
Post's attachments

Attachment icon deletePassword.rar 4.78 kb, 48 downloads since 2024-02-16 

Re: passcode

pavlenko.vladimir.v wrote:
ms2014m wrote:

How can when I press the delete key it asks for the passcode to confirm the deletion?

procedure Form1_Button2_OnClick (Sender: TObject; var Cancel: boolean);
var
 pass : string = '1234jkjh';
 inputPass : string;
begin
  InputQuery('Подтверждение удаления ','Для удаления записи введите пароль',inputPass);
  if (inputPass <> pass) then Cancel := True;
end;


Thank you very much
It works well, but when deleting the first time, it asks for the password, and when deleting the second time, I find the password registered automatically, and this is not good.
Is it possible to create a page where I can change the password and save it?

Re: passcode

you can try setting InputPass as empty string.
as to saving the password, there's a couple of way to do it in my perspective.
you can save it in database. or in an ini file. but make sure to encrypt it.

Post's attachments

Attachment icon deletePassword2.zip 1.02 mb, 41 downloads since 2024-02-17 

brian