【发布时间】:2014-10-20 09:07:05
【问题描述】:
我需要一些帮助。我有一个外部应用程序(带有一些 dll 文件的 test.exe)。在 cmd 中,我运行如下命令:test.exe parmeters 并获取大量数据和一些需要的信息。
我编写了执行此外部应用程序的应用程序,并且输出不完全,因为我使用 cmd 执行它。这只是一些第一行。我不介意有什么问题。请帮忙
using(var process = new Process {
StartInfo = new ProcessStartInfo {
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
FileName = orPath,
Arguments = parmeters.ToString(),
}
}) {
process.Start();
process.WaitForExit();
string result = "";
string standard_output;
while ((standard_output = process.StandardOutput.ReadLine()) != null) {
if (standard_output.Contains("xx"))
result = standard_output.Substring(standard_output.Length - 15);
}
【问题讨论】:
-
您的问题并不完全清楚,您能否尝试改写您的问题?什么输出不完全,你期待什么?
argBuilder中的内容是什么?