views:

31

answers:

0

Possible Duplicate:
How can I determine whether Console.Out has been redirected to a file?

Is there a way of telling whether the stdin stream to a console app is coming from the console or from a file using .Net?

I'm writing an app that should read from a file on the stdin if there is one but ideally shouldn't read from the stdin when it's just the user typing at the console.

Alternatively

Is there a way to detect when the user ends their typing at the console short of reading character by character and waiting for them to hit some app specific finished key combination?