I have a program that uses Console.WriteLine(); to output to the user in many different locations in the program. Is there a way to get what line the last printed line of output is in the console application? Without incrementing a counter every Console.WriteLine();. For example, in the following code "Bar Foo" would have printed as line 4. Here would be an example program:
Console.WriteLine("Foo");
Console.WriteLine("Foo Bar");
Console.WriteLine("Bar");
Console.WriteLine("Bar Foo");
output:
Foo
Foo Bar
Bar
Bar Foo