string path = "abc\\ab.txt";
string[] memo = System.IO.File.ReadAllLines(path);
int totalLines = textBox2.Lines.Length;
string lastLine = textBox2.Lines[totalLines - 1];
for (int i = 0; i < 6; i++)
{
string a = memo[i];
if (a.Contains(lastLine))
{
textBox2.Text = (textBox2.Text + Environment.NewLine + memo[i + 1]);
break;
}
else
{
MessageBox.Show("not found");
}
}
if else
doesn't work.
If I write the code like under:
else
{
MessageBox.Show("cs0162 c# unreachable code detected");
break;
}
The warning message is:
cs0162 c# unreachable code detected"come out.