hi, i need to search the text file for lines repeatedly. so i want to read the text file into memory and iterate through lines.
i am able to iterate as follows but, for the next search i need to iterate from the beginning which will require data transfer between hard drive and memory. instead i want to read it all it once to memory then iterate through it.
TextReader tr = new StreamReader(fileName);
string input = null;
while ((input = tr.ReadLine()) != null)
// some code
the above is not i want.