I tried using System.Console.In.ReadToEnd (for code-golf, as it happens), but I can't work out what the key sequence is to get it to return from the console.
+1
A:
Ctrl+Z signals end-of-stream when typed in a console window interactively.
http://en.wikipedia.org/wiki/End-of-file
(Ctrl+Z has to be entered on a new line, and followed by enter)
John Knoeller
2010-02-08 10:02:07
+1: FYI: For whatever reason I have to press enter before it will pickup the CTRL+Z (granted it stops reading after it hits CTRL+Z)
Binary Worrier
2010-02-08 10:12:49
I think the enter is because console input gives you an opportunity to edit a line it is sent to standard in
John Knoeller
2010-02-08 10:18:31
The Ctrl+Z has to be on a new line, and followed by an Enter, I've edited and accepted the answer accordingly. I can't find this documented anywhere though.
Benjol
2010-02-08 10:29:34
That's good to know, I've always put it on a new line, but I never knew it was required. It's just something another programmer taught me back when the command prompt was DOS.
John Knoeller
2010-02-08 10:33:49