Czy ktoś byłby tak miły i przeanalizował kod, bo głowię się i nie mogę dojść co jest nie tak.
private void button1_Click(object sender, EventArgs e)
{
string login = textBox1.Text;
string password = textBox2.Text;
string tmp1;
string linia;
bool check = false;
tmp1 = login + " " + password;
FileStream fs = new FileStream("lekarze.txt", FileMode.Open, FileAccess.Read);
try
{
StreamReader sr = new StreamReader(fs);
while ((linia = sr.ReadLine()) != null)
{
linia = sr.ReadLine();
if (linia.Equals(tmp1)) check = true;
}
sr.Close();
fs.Close();
}
catch (FileNotFoundException)
{
MessageBox.Show("Brak pliku źródłowego lekarze ");
}
if (check == true)
{
Form3 Form3 = new Form3();
Form3.Show();
this.Hide();
}
}