delphi logon code

Thread Solved

Join Date: Oct 2009
Posts: 2
Reputation: Jayno4 is an unknown quantity at this point 
Solved Threads: 0
Jayno4 Jayno4 is offline Offline
Newbie Poster

delphi logon code

 
-1
  #1
Oct 2nd, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 444
Reputation: FlamingClaw will become famous soon enough FlamingClaw will become famous soon enough 
Solved Threads: 106
FlamingClaw's Avatar
FlamingClaw FlamingClaw is offline Offline
Posting Pro in Training

Re: delphi logon code

 
1
  #2
Oct 2nd, 2009
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...
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 2
Reputation: Jayno4 is an unknown quantity at this point 
Solved Threads: 0
Jayno4 Jayno4 is offline Offline
Newbie Poster

Re: delphi logon code

 
0
  #3
Oct 2nd, 2009
Originally Posted by FlamingClaw View Post
What do you want?To log into a computer or just your program?
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 444
Reputation: FlamingClaw will become famous soon enough FlamingClaw will become famous soon enough 
Solved Threads: 106
FlamingClaw's Avatar
FlamingClaw FlamingClaw is offline Offline
Posting Pro in Training

Re: delphi logon code

 
1
  #4
Oct 3rd, 2009
one alternative is
  1.  
  2. procedure TForm1.Button1Click(Sender: TObject);
  3. var
  4. count: integer;
  5. begin {main}
  6. count:=3;
  7. If edit1.Text='Jayno4' Then
  8. Begin
  9. Edit1.Readonly:=true;
  10. end else if MaskEdit1.Text='jaynesh' Then
  11. Begin
  12. form3.Visible:=True;
  13. end else Begin
  14. Dec(count);{same as count:=count-1}
  15. ShowMessage('Incorrect username and password');
  16. if (count=0) then begin
  17. ShowMessage('Program is exiting...');
  18. sleep(200);
  19. close;
  20. end;
  21. end;
  22. 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...
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Pascal and Delphi Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC