System.Diagnostics.Process.OutputDataReceived事件中的字体颜色 [英] font color in System.Diagnostics.Process.OutputDataReceived event

查看:97
本文介绍了System.Diagnostics.Process.OutputDataReceived事件中的字体颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我们使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆