| | |
delphi logon code
Thread Solved |
•
•
Join Date: Oct 2009
Posts: 2
Reputation:
Solved Threads: 0
hi i need to write a logon code for delphi 7 that logs on to someone and then if they get the password wrong 3 time they get locked out. i am completely stuck i have a log on code written but i don't know where to go after that. the log on code is
procedure TForm1.Button1Click(Sender: TObject);
var
count: integer;
begin
If edit1.Text='Jayno4' Then
Begin
Edit1.Readonly:=true;
end
else
If MaskEdit1.Text='jaynesh' Then
Begin
form3.Visible:=True;
end
else
Begin
ShowMessage('Incorrect username and password');
end;
end;
end
procedure TForm1.Button1Click(Sender: TObject);
var
count: integer;
begin
If edit1.Text='Jayno4' Then
Begin
Edit1.Readonly:=true;
end
else
If MaskEdit1.Text='jaynesh' Then
Begin
form3.Visible:=True;
end
else
Begin
ShowMessage('Incorrect username and password');
end;
end;
end
What do you want?To log into a computer or just your program?
Be a good part of the community.Don't be ungrateful.
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
•
•
Join Date: Oct 2009
Posts: 2
Reputation:
Solved Threads: 0
basically on a form there is a button called log in and what happens is when the people put the right details in to the edit box and the mask edit it logs them in and shows them a new form but if they get it wrong they get another try and after 3 tries i need it to close the application and show message saying you have now been locked out. the main part i am stuck at is trying to make it give the person 3 tries
one alternative is
delphi Syntax (Toggle Plain Text)
procedure TForm1.Button1Click(Sender: TObject); var count: integer; begin {main} count:=3; If edit1.Text='Jayno4' Then Begin Edit1.Readonly:=true; end else if MaskEdit1.Text='jaynesh' Then Begin form3.Visible:=True; end else Begin Dec(count);{same as count:=count-1} ShowMessage('Incorrect username and password'); if (count=0) then begin ShowMessage('Program is exiting...'); sleep(200); close; end; end; end;{of main}
Be a good part of the community.Don't be ungrateful.
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
![]() |
Similar Threads
- C++ to Delphi CheckSum code (Pascal and Delphi)
- can anyone compile this code ? (Pascal and Delphi)
- Delphi 16 bit - Code segment too large (Pascal and Delphi)
- delphi object casting (Pascal and Delphi)
- Delphi 7 & DPlot Jr (Pascal and Delphi)
- Jumps into code on program end (Pascal and Delphi)
Other Threads in the Pascal and Delphi Forum
- Previous Thread: Containing numbers - how?
- Next Thread: How to find the most common word in a Linked List in Pascal.
| Thread Tools | Search this Thread |





