【问题标题】:How do you read the console output from windows commands in C++? [duplicate]如何从 C++ 中的 Windows 命令读取控制台输出? [复制]
【发布时间】:2011-03-27 17:37:43
【问题描述】:

可能重复:
How can I run an external program from C and parse its output?

如果您从程序内部运行 Windows 命令(以 ipconfig 为例),您如何读取系统返回给您的输出到程序中进行处理?

【问题讨论】:

    标签: c++ windows


    【解决方案1】:

    请参阅 MSDN 上的 Creating a Child Process with Redirected Input and Output

    或者,您可以使用_popen 来简单地捕获输出。

    【讨论】:

      猜你喜欢
      • 2013-04-26
      • 1970-01-01
      • 2016-06-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多