Reading from Standard Input in C#
<p>I'm trying to read in a text file from the command prompt in C#, via </p>

<pre><code>program.exe &lt; textfile.txt 
</code></pre>

<p>However, I cannot find the correct way to do this.</p>

<p>So far, I've only been able to pass the path and the filename to string [] args and then opening the file with the StreamReader class. While this is an acceptable alternative, I've been told that the method with "&lt;", which I suppose is a redirection of standard input, offers advantages like not requiring file handling.</p>

<p>Can anyone give some insight into this? </p>

<p>edit: Program.exe is my C# application. </p>