Hi, I have a winform app that is writing to console and it seems to work well. I'm using this code:
AttachConsole(-1)
Console.Out.WriteLine("Hellow world")
FreeConsole()
The question is: If I run the app's exe file from command line, and try to redirect the output into a file. It doesn't work. For example:
C:\ > myapp.exe > c:\output.txt
I still get the output to console screen (c:\output.txt file is created but empty), but I want it to to be saved into c:\output.txt What's going wrong ? How to do that?
Many thanks!