C#_____поиск по файлам txt !!!help!!!
Люди, помогите разобраться!
//chislo_f - число всех файлов txt (объявлено ранее)
// кнопка НАЙТИ
private void button1_Click(object sender, EventArgs e) {
string iskomoe = textBox1.Text;
string odin_dva_lin;
//поиск по двум верхним строкам файлов txt
string[] files = Directory.GetFiles(@"H:\C#.NET Поиск\Прог-а\bin\Debug", "*.txt");
foreach (string chislo_f in files)
{
using (StreamReader file_read = new StreamReader(chislo_f, Encoding.Default))
{
odin_dva_lin = File.ReadLines(chislo_f).ElementAt(1);
if (odin_dva_lin.Contains(iskomoe)) // == "*"+ iskomoe +"*" )
listBox1.Items.Add(chislo_f);
}
}
}
никаких ошибок не выявлено, но listBox1 остается пустым! где тут может быть подвох? может дело в кодировке??