• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

在Delphi控制台应用程序的stdin / stdout上打开TStream

用户头像
it1352
帮助1

问题说明

我正在尝试编写一个Delphi控制台应用程序,为其标准输入创建一个TStream,另一个TStream用于标准输出。

I'm trying to write a Delphi console application that creates a TStream for its standard input, and another TStream for its standard output.

(将会启动通过主机应用程序,其输入和输出重定向到管道,并将传递二进制数据到/从该主机应用程序,所以TStream将比ReadLn / WriteLn更适合任务。)

(It will be launched by a host app with its input and output redirected to pipes, and will be passing binary data to/from that host app, so TStream will be much better-suited to the task than ReadLn/WriteLn.)

如何在标准输入或标准输出上打开TStream?

How do I go about opening a TStream on standard input or standard output?

正确答案

#1

我的头顶:

  InputStream := THandleStream.Create(GetStdHandle(STD_INPUT_HANDLE));
  OutputStream := THandleStream.Create(GetStdHandle(STD_OUTPUT_HANDLE));

给你一个..

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcfggeb
系列文章
更多 icon
同类精品
更多 icon
继续加载