System.Diagnostics.Process.OutputDataReceived事件中的字体颜色 [英] font color in System.Diagnostics.Process.OutputDataReceived event
问题描述
最近我们使用System.Diagnostics.Process运行其他程序并使用 OutputDataReceived事件来捕获进程结果,但是一些程序使用字体颜色来确定进程状态,是否可以获取字体
程序输出中的颜色。
设置字体颜色 - 是的。获得字体颜色 - 没有。输出只是文本。但好的程序会将错误写入stderror,你可以将stdout与stderror分开。应使用stderror编写(和监控)错误。
Michael Taylor
http://www.michaeltaylorp3.net
Recently we using System.Diagnostics.Process to run other program and using OutputDataReceived event to capture the process result, but some of the program using font color to determine process status, is that possible to get the font color in program outputs.
To set font color - yes. To get font color - no. The output is just text. But good programs will write errors to stderror and you can separate stdout from stderror. Errors should be written (and monitored) using stderror.
Michael Taylor
http://www.michaeltaylorp3.net
这篇关于System.Diagnostics.Process.OutputDataReceived事件中的字体颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!