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

Re: Logic Help by Bob

Bob
Sat Oct 16 06:02:55 CDT 2004

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






"Joanne" <Joanne@discussions.microsoft.com> wrote in message
news:3CFF2843-4EA9-4904-BDFF-72614CDC3EF7@microsoft.com...
> 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



Re: Logic Help by Morten

Morten
Sat Oct 16 06:13:26 CDT 2004

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.

--
Happy Coding!
Morten Wennevik [C# MVP]

Re: Logic Help by Bishoy

Bishoy
Sat Oct 16 07:51:47 CDT 2004

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

"Joanne" <Joanne@discussions.microsoft.com> wrote in message
news:3CFF2843-4EA9-4904-BDFF-72614CDC3EF7@microsoft.com...
>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