Не могли бы вы помочь мне понять, где моя ошибка при запуске кода?Я ожидаю восстановить выходную строку из оболочки CMD из приложения, созданного на C #, и я получаю все в одной строке без разделения строк.Я использую CLI для автоматического тестирования.Смотрите прикрепленный код и фотографии.Заранее спасибо.s строка:
Microsoft Windows [Version 10.0.16299.431]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\evgen\source\repos\testim_ex1\testim_ex1\bin\Debug>testim --token "98IQGMuu1jTaBp3HvIMkmsk6tTa2jrS4hUFE247rX9ef0s3FAp" --project "KsfNpLJSbdNlY8czyuwb" --host "ondemand.testim.io" --port 4444 --report-file testim-report.xml --label "EvgenyShai"
Starting Testim.io CLI
Warning: You are using version 1.16.0, a newer version is available. To update please run npm install (npm install -g @testim/testim-cli)
-----------------------------------------------------------------------
Running Project: KsfNpLJSbdNlY8czyuwb Label: [ 'EvgenyShai' ] Branch: master
-----------------------------------------------------------------------
Batch execution huueFFGwEk was created
Got batch to run:
1 : Search show in eztv (3gHheApBMO)
-----------------------------------------------------------------------
W:1 Test Search show in eztv started (3gHheApBMO) url: https://app.testim.io/#/project/KsfNpLJSbdNlY8czyuwb/branch/master/test/3gHheApBMO?result-id=2ox8E7Emku
W:1 Get browser Search show in eztv
W:1 Wait for test start
W:1 Wait for test complete
W:1 Test Search show in eztv finished status: PASSED (3gHheApBMO) duration: 0:0:0:17.955
-----------------------------------------------------------------------
Execution completed id: huueFFGwEk Label: [ 'EvgenyShai' ] Duration: 0:0:0:32.945 PASSED: 1 FAILED: 0
-----------------------------------------------------------------------
JUnit XML file saved to testim-report.xml
C: \ Users \ evgen \ source \ repos \ testim_ex1 \ testim_ex1 \ bin \ Debug>
private void B_RunTest_Click(object sender, EventArgs e)
{
ProcessStartInfo psi = new ProcessStartInfo("cmd");
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
psi.CreateNoWindow = true;
psi.RedirectStandardInput = true;
var proc = Process.Start(psi);
t = TB_CLIstring.Text.ToUpper();
if (t == "CLS")
{
proc.StandardInput.WriteLine(TB_CLIstring.Text);
proc.StandardInput.Flush();
proc.StandardInput.Close();
TB_CMD_Output.Text = "";
}
else
{
proc.StandardInput.WriteLine(TB_CLIstring.Text);
proc.StandardInput.Flush();
proc.StandardInput.Close();
s = proc.StandardError.ReadToEnd() + proc.StandardOutput.ReadToEnd();
TB_CMD_Output.Text = s;
}
}
Как должно быть:

Как это:
