string[] usernames;
string[] password ;
bool username;
bool passok;
bool match;
string passinp;
string userinp;
protected void Button1_Click(object sender, EventArgs e)
{
StreamReader SrUs = new StreamReader("Usernames.txt");
StreamReader SrPass = new StreamReader("Password.txt");
int i = 0;
while(!SrUs.EndOfStream)
{
usernames[i] = SrUs.ReadLine();
}
i = 0;
while(SrPass.EndOfStream)
{
password[i] = SrPass.ReadLine();
}
if (txt_pass.Text != "" && txt_username.Text != "")
{
passinp = txt_pass.Text;
userinp = txt_username.Text;
}
else
{
Label3.Text = "Missing information";
}
int j = 0;
for(i = 0;i < usernames.Length;i++)
{
if(usernames[i] == userinp)
{
username = true;
break;
}
}
for(j = 0 ; j < password.Length;j++)
{
if(password[j]==passinp)
{
passok = true;
break;
}
}
if(username && passok && i == j)
{
Label3.Text = "Logon Correct";
}
else
{
Label3.Text = "Logon Incorect";
}
}
protected void Button2_Click(object sender, EventArgs e)
{
}
}
}
So when I run this it gives me an error that it can't find txt file, is it same in asp.net and in windows form app use of streamreader, I put txt files inside bin and root folder but again it gives me the same error.