File.ReadLine() не выводит первую строку файла - C#
Формулировка задачи:
// Read the file and display it line by line.
StreamReader file = new StreamReader(fileName, Encoding.Default);
while ( !file.EndOfStream )
{
if ( file.ReadLine().StartsWith(name) & hands != null )
{
MessageBox.Show(file.ReadLine());
pokerStarsLogic(hands);
MessageBox.Show(hands);
hands.Remove(0);
}
hands += file.ReadLine();
}
file.Close();
}// Read the file and display it line by line.
StreamReader file = new StreamReader(fileName, Encoding.Default);
while ( !file.EndOfStream )
{
if ( file.ReadLine().StartsWith(name) )
{
MessageBox.Show(file.ReadLine());
pokerStarsLogic(hands);
MessageBox.Show(hands);
if ( hands != null ) hands.Remove(0);
}
hands += file.ReadLine();
}
file.Close();
}Решение задачи: «File.ReadLine() не выводит первую строку файла»
textual
Листинг программы
if ( file.ReadLine()