I found lots of samples how to redirect console output into a file. However I need an opposite solution - I have StreamWriter which I want to be shown in the Console output once I do sw.WriteLine("text");
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
Just point the stream to standard output:
Not that previous answer not correct, but since i do not have enough reputation level to add comment, just adding another answer:
If you would ever use pointing Stream to standard output as John proposed with using statement you should not forget to re-open console Stream later on, as explained in https://docs.microsoft.com/en-us/dotnet/api/system.console.setout?view=netframework-4.7.2