【发布时间】:2011-03-27 17:37:43
【问题描述】:
可能重复:
How can I run an external program from C and parse its output?
如果您从程序内部运行 Windows 命令(以 ipconfig 为例),您如何读取系统返回给您的输出到程序中进行处理?
【问题讨论】:
可能重复:
How can I run an external program from C and parse its output?
如果您从程序内部运行 Windows 命令(以 ipconfig 为例),您如何读取系统返回给您的输出到程序中进行处理?
【问题讨论】:
请参阅 MSDN 上的 Creating a Child Process with Redirected Input and Output
或者,您可以使用_popen 来简单地捕获输出。
【讨论】: