I have a function in c# class which is reading a textfile into streamreader.Here is the c# function.
public readFile(string fileName, long startPosition = 0)
{
//Open the file as FileStream
_fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
_reader = new StreamReader(_fileStream);
//Set the starting position
_fileStream.Position = startPosition;
}
and i am trying to call this function into another class and read the file line by line.
private AddedContentReader _freader;
protected override void OnStart(string[] args)
{
_freader = new AddedContentReader(file);
}
So my question is how to read the textfile line by line in the calling function
Please help me..