I am new to C#, but have programmed in another language (RPG) for 40 years.
I've written a program to read an error log file, searching for certain keywords (errors) that we need notification on. When I reach end of file, I want the program to go to sleep for a period time, then wake up and resume reading the file from where I left off.
In RPG, there are a number of op codes and processes that I would use (in this case, it would be reading the file by relative record number) where I would save the last RRN I read, sleep and then start at the next RRN from where I left off. I would repeat this process until the program is sent a termination code or if a new day starts (after midnight).
How do I accomplish this in C# using either StreamReader or some other process? I tried reader.BaseStream.Position, passing it a line number from the previous read statement, but that doesn't do what I expect. Help would be appreciated.