小编Qui*_*man的帖子

读取另一个正在运行的应用程序

我正在使用C#中的自定义IDE编写脚本语言,我遇到了问题.

我正在尝试启动编译器进程(pawncc.exe)并将参数传递给它.我已经做到了,现在我遇到了问题.当我想显示编译器应用程序的输出时,它只显示它的某些部分.它应该输出这个(从命令提示符获取):

Pawn compiler 3.2.3664                  Copyright (c) 1997-2006, ITB CompuPhase

newGM.pwn(0) : fatal error 100: cannot read from file: "includes/main_include.inc"

Compilation aborted.
1 Error.
Run Code Online (Sandbox Code Playgroud)

但事实并非如此.它输出(在应用程序中,使用相同的命令/参数):

Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Run Code Online (Sandbox Code Playgroud)

我只是不明白!这真的很奇怪.这可能是一件简单的事情,但我一直在研究它,现在研究几个小时!这是我的代码:

        public Form3(string path)
        {
            InitializeComponent();

            this._path = path;

            Process myProcess = new Process();
            ProcessStartInfo startInfo = new ProcessStartInfo("pawncc.exe");
            startInfo.CreateNoWindow = true;
            startInfo.UseShellExecute = false;
            startInfo.RedirectStandardOutput = true;
            startInfo.Arguments = path + " -r -d2";
            myProcess.StartInfo = startInfo;
            myProcess.Start();

            while (true) …
Run Code Online (Sandbox Code Playgroud)

c# command winforms output

7
推荐指数
1
解决办法
2702
查看次数

标签 统计

c# ×1

command ×1

output ×1

winforms ×1