I would have expected the following C# program to only print \"EOF!\" once I hit \"Ctrl-Z\" in the console. Instead, the program finishes as soon as I hit Enter:
Console.In.Read() returns -1 on EOF, So you can do this:
int c; while((c = Console.In.Read()) != -1) Console.Out.Write((char)c);