class Program
{
public static bool findInText(int SearchValue, string filePath)
{
using (StreamReader r = new StreamReader(filePath))
{
string line;
while ((line = r.ReadLine()) != null)
{
int x = Int32.Parse(line);
if (x == SearchValue) return true;
}
return false;
}
}
static void Main(string[] args)
{
string File = "C:\\test.txt";
Console.WriteLine(findInText(18, File));
}
}