Logic Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need some help with user names and passwords (five users and one password
for each user). I have two txtboxes (txtName, txtPassword). If a user
clicks enter and both are empty then a message is displayed, "enter user
name." If just the name is entered the message "enter password." If wrong
name and right password then message "re-enter name." If right name and
wrong password message "valid name, wrong password." I cant figure this out,
can someone help me please? The names are tied to a passwords, for example a
user might have 123 for a name and a password of 456
 
The 'logic' here should be that each person should know his or her password
and no-other. If the name-password combination is wrong don't give the users
"mastermind" type clues about which bit was good and bad..

If the combination is bad, just say "username or password incorrect"

--
Bob Powell [MVP]
Visual C#, System.Drawing

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml
 
Hi Joanne,

Although it might be user friendly to tell the user if it was the name or
the password is incorrect it isn't very secure and it is not adviced.

If you don't need a secure setup you could easily check if the password is
correct for a given user (depending on how you store usernames/passwords),
but for unknown username you would need to check each password in turn.
Bear in mind that if the user is allowed to set his/her own password you
might end up with two users having the same password, although it looks
like you are specifying the passwords yourself.

It is easy enough to manage, but how to do it depends on how you
store/lookup usernames/passwords.
 
The Logic is like this:

if username correct then
if password correct then
successfull login
exit
else
wrong password
end if
else
wrong username
end if
 
Back
Top