943,602 Members | Top Members by Rank

Ad:
Sep 28th, 2005
0

Login screen

Expand Post »
Hi everyone,

I'm making yet another program, and i am needing a login screen. The first form has 2 edit boxes and 2 buttons. The cancel button closes the program, the login button checks the username password if there correct or not. I have written the code for the login button but an error message keeps apearing every time I click the login button. The code that i have user is as follows:

begin
If edit1.Text='Admin' Then
Begin
Edit1.Readonly:=true;
end
else
If edit2.Text='1234' Then
Begin
form2.Visible:=True;
end
else
Begin
ShowMessage('Incorrect username and password');
end;

Could someone please help me out.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
satrix36 is offline Offline
20 posts
since Aug 2005
Oct 7th, 2005
0

Re: Login screen

What is the error cos the above code is ok

if enters Admin sets the editbox to readonly
if enters 1234 shows form2

if neither above are true then shows 'Incorrect username and password'
Reputation Points: 11
Solved Threads: 0
Light Poster
mrmike is offline Offline
41 posts
since May 2005
Oct 7th, 2005
0

Re: Login screen

I've figured it out now.
Thank you for ur help.

Just a quick question, How would I encrypted the username and password?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
satrix36 is offline Offline
20 posts
since Aug 2005
Mar 16th, 2009
0

Re: Login screen

Click to Expand / Collapse  Quote originally posted by satrix36 ...
I've figured it out now.
Thank you for ur help.

Just a quick question, How would I encrypted the username and password?
how did you do it in your login screen?? that's also one of my problem.. I'm doing a system that has a login screen and if the privilege is student then it will open immediately the student forms which can only view the information. Thus, if the privilege is physician then it can add, edit and view the information. But, still, I don't know how to do it..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
malditcha87 is offline Offline
3 posts
since Mar 2009
Mar 16th, 2009
0

Re: Login screen

Click to Expand / Collapse  Quote originally posted by satrix36 ...
I've figured it out now.
Thank you for ur help.

Just a quick question, How would I encrypted the username and password?
how did you do it in your login screen?? that's also one of my problem.. I'm doing a system that has a login screen and if the privilege is student then it will open immediately the student forms which can only view the information. Thus, if the privilege is physician then it can add, edit and view the information. But, still, I don't know how to do it..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
malditcha87 is offline Offline
3 posts
since Mar 2009
Mar 23rd, 2009
0

Re: Login screen

I'm guessing you were getting an access violation error, which usually means you are trying to access properties of an object that has not yet been created. Has form2 been created already but has been hidden or visible:=false?

For encryptions, depends on how secure you need it to be. Some easy things you can do is:

1. Add an offset to each character, like "M" is an ASCII 77, so replace it with ASCII 127, for example. Similarly, you could do all sort of character-by-character operations, like vary the offset according to the position in the string, or make other bit-level changes.

2. Jumble the letters

3. Mix the string in with another long and randomly generated string.

4. Use a public-key type routine. The math is easy, but to be effective you have to use some big numbers.
Reputation Points: 10
Solved Threads: 1
Light Poster
m610 is offline Offline
40 posts
since Oct 2008
Mar 23rd, 2009
0

Re: Login screen

how did you do it in your login screen?? that's also one of my problem.. I'm doing a system that has a login screen and if the privilege is student then it will open immediately the student forms which can only view the information. Thus, if the privilege is physician then it can add, edit and view the information. But, still, I don't know how to do it..
do you know who to change the dbgrid menutitle?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
malditcha87 is offline Offline
3 posts
since Mar 2009

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: Terminating a thread in OnDestroy
Next Thread in Pascal and Delphi Forum Timeline: Help Randomizing





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


Follow us on Twitter


© 2011 DaniWeb® LLC