C# Output to current Command Prompt?
<p>I am working on Windows Form (C# application), and when I run this application from cmd.exe, the message (error log, debug log) is output to message box.</p>

<p>How should I do to output this message to current CMD.exe which I ran C# appliation?</p>

<p>Example:
I do </p>

<pre><code>C:&gt;D:\Demo\CsOutputMsgToCMD\CsOutputMsgToCMD\bin\Release\CsOutputMsgToCMD.exe 1
</code></pre>

<p>Output: This message must be output in current CMD</p>

<pre><code>The argument is 1
</code></pre>

<p><strong>Update #1</strong>: My C# application is Windows Form application (Not console)
But I want when user run this application from cmd.exe</p>

<ul>
<li>Case #1: Have NOT any argument: It launch the application normally (GUI)</li>
<li><p>Case #2: Have argument</p>

<ul>
<li>If argument == 1, I do action #1 without launch GUI</li>
<li>If argument == 2, I do action #2 without launch GUI</li>
<li>If argument == n, I do action #n without launch GUI</li>
</ul>

<p>=> When not launch GUI app, the output must be in current cmd.exe (which ran application)</p></li>
</ul>