WPF 将输出在控制台的文本放入TextBox中

StringBuilder outSb=newStringBuilder();

StringWriter Sw=new StringWriter(outSb);

Console.SetOut(Sw);
输出到控制台的文本
Console.WriteLine(“Console Test!”);
//给textBox赋值
textBox1.Text=outSb.ToString();

 

WPF 将输出在控制台的文本放入TextBox中

上一篇:windows与Linux写入后门


下一篇:【Git】pull遇到错误:error: Your local changes to the following files would be overwritten by merge: