I'm trying to set up a log in page, the first page of the website.
It has a username, then textbox for user to write - then password, and textbox for them to write. Then a Log in button.
I'm trying to figure out a way, so that when the user presses the Log In button, they will only be directed to the next page if their username and password matches what I've got on a document.
Any idea on how I can go about doing this with arrays and if statements? I'm quite stuck!
This is what I've currently got, under protected void logInButton_Click(object, sender, EventArgs e)
{
string usernameListString = Server.MapPath("~") + "/App_data/usernameFile.txt";
string[]userArray = usernameListString.Split(' ');
bool usernameExists = false;
for (int i=0;i>usernameListString.Length;i--)
{
if (userArray[i] = usernameTextBox.Text)
{
usernameExists = true;
}
if (usernameExists == tru ...
Go to the complete details ...