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.
How should I do to output this message to current CMD.exe which I ran C# appliation?
Example: I do
C:>D:\Demo\CsOutputMsgToCMD\CsOutputMsgToCMD\bin\Release\CsOutputMsgToCMD.exe 1
Output: This message must be output in current CMD
The argument is 1
Update #1: My C# application is Windows Form application (Not console) But I want when user run this application from cmd.exe
- Case #1: Have NOT any argument: It launch the application normally (GUI)
Case #2: Have argument
- If argument == 1, I do action #1 without launch GUI
- If argument == 2, I do action #2 without launch GUI
- If argument == n, I do action #n without launch GUI
=> When not launch GUI app, the output must be in current cmd.exe (which ran application)