I want to write a Person class that has their details, including a username and password.
What I want then to do is create a login where the user types in their username and password and then it gets checked for every instance that has been created of that class
if (p1.getUser == userInput && p1.getPass == passInput)
{
Login();
}
else
.... Check the next instance until you've checked every instance.
Can anyone think of a good way to pull that off?
I would (basically like every web site on the planet) store the users in a database and use a query to find them:
Note: Normally, the password is saved as the hash rather than the plain text
However, if you really want a code-only solution, do this: