Redirecting Console.WriteLine() to Textbox

前端 未结 4 1659
死守一世寂寞
死守一世寂寞 2020-12-04 18:08

I\'m building this application in Visual Studio 2010 using C#.

Basically there are 2 files, form1.cs (which is the windows form) and program.cs (where all the logic

4条回答
  •  执念已碎
    2020-12-04 18:41

    Don't know if it will work, but you could try to redirect console output.

    Use Console.SetOut() and create derivative of TextWriter which overrides WriteLine() method and simply assign method parameter to your TextBox.Text Should work.

提交回复
热议问题