tags:

views:

24

answers:

1

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
+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
I think the enter is because console input gives you an opportunity to edit a line it is sent to standard in
John Knoeller
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
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