问题描述
在我的windows应用程序中,我需要执行一个批处理文件。
这个批处理文件会向屏幕抛出一些文字和问题,我需要
捕获标准输出,检查它是否是一个问题,如果它是一个问题,
i想要弹出一个messageBox或者其他东西,然后带上回到批处理文件
结果(是的没有问题)。我知道如何执行批处理文件并在最后得到所有
标准输出,但我不知道我能通过
行和检查它是否是一个问题,如果是,请将结果带回
批处理文件。
有人可以帮我吗?
谢谢,
Gidi。
Hi,
In my windows applicationm, i need to excute a batch file.
this batch file throws some text and questions to the screen, i need to
catch the standard Output, check if it''s a question, in case it''s a question,
i want to popup a messageBox or something, and bring back to the batch file
the result (Yes\No question). I know how to excute the batch file and get all
the Standard output at the end, but i don''t know who can i read it line by
line and check if it''s a question, and in case it is, bring the result to the
batch file back.
can anyone help me here?
Thanks,
Gidi.
推荐答案
嗯,检查此MSDN条目中包含的样本是否有帮助 - 听起来好像
大概就像你打算做的那样...
问候,
Gilles。
Hmm, check if the sample contained in this MSDN entry helps - sounds
approximately like what you intend to do ...
http://msdn2.microsoft.com/en-us/lib...treadline.aspx
Regards,
Gilles.
嗯,检查这个MSDN条目中包含的样本是否有帮助 - 听起来好像
大概就像你打算做的那样...
问候,
Gilles。
Hmm, check if the sample contained in this MSDN entry helps - sounds
approximately like what you intend to do ...
http://msdn2.microsoft.com/en-us/lib...treadline.aspx
Regards,
Gilles.
这篇关于使用标准输出和输入运行批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!