Disclaimer: I come from a C++ background and started C# recently.
For some reason, I cannot write to the console's standard output like this:
new StreamWriter(Console.OpenStandardOutput()).Write("Stackoverflow");
Any suggestions?
sw = new StreamWriter(Console.OpenStandardOutput());
sw.AutoFlush = true;
Console.SetOut(sw);
sw.WriteLine("Stackoverflow");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.