944,149 Members | Top Members by Rank

Ad:
Oct 2nd, 2009
-1

delphi logon code

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Jayno4 is offline Offline
2 posts
since Oct 2009
Oct 2nd, 2009
1

Re: delphi logon code

What do you want?To log into a computer or just your program?
Reputation Points: 132
Solved Threads: 138
Posting Pro
FlamingClaw is offline Offline
559 posts
since Feb 2009
Oct 2nd, 2009
0

Re: delphi logon code

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Jayno4 is offline Offline
2 posts
since Oct 2009
Oct 3rd, 2009
1

Re: delphi logon code

one alternative is
delphi Syntax (Toggle Plain Text)
  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}
Reputation Points: 132
Solved Threads: 138
Posting Pro
FlamingClaw is offline Offline
559 posts
since Feb 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: Containing numbers - how?
Next Thread in Pascal and Delphi Forum Timeline: How to find the most common word in a Linked List in Pascal.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC