If you have the file loaded as a string, then you can use .IndexOf to find the specific keyword, and then search backwards until you find the end of the preceding line (or start of the file). You won't know the line number, but you will have the whole line (per "read the relative line").
But if you already have the file in memory as a string, then is still probably simpler to split that string into lines and then search the lines.