using System;
using System.IO;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int found = 0;
string line;
using (System.IO.StreamReader file = new System.IO.StreamReader("d:\\test.txt"))
{
while ((line = file.ReadLine()) != null)
{
if (line.Contains("Programming"))
{
found = 1;
break;
}
}
}
if (found == 1)
Console.WriteLine("Found\n"); // Found (in the text file the word 'Programming' exist)
else
Console.WriteLine("NOT Found\n");
}
}
}
/*
run:
Found
*/