у меня есть фрагмент кода, который я пытаюсь исправить:Добавить ввод текстового поля к существующему StartInfo.Arguments
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
//p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = false; // This line will not create any new window for command prompt.
p.StartInfo.FileName = @"C:\Program Files (x86)\Citrix\System32\dscheck.exe";
p.StartInfo.Arguments = "/full groups /clean";
p.StartInfo.Arguments = argTextBox.Text;
p.Start();
System.Threading.Thread.Sleep(50);
System.Windows.Forms.SendKeys.Send("y");
System.Threading.Thread.Sleep(50);
string s = p.StandardOutput.ReadToEnd();
MessageBox.Show(s); //Shows a Popup of the output from Dscheck
//String s = p.StandardOutput.ReadToEnd();
Вот мой вопрос:
p.StartInfo.Arguments = "/full groups /clean";
p.StartInfo.Arguments = argTextBox.Text;
Я пытаюсь передать tscheck.exe /full /groups /clean {UID}
- UID введен в argTextBox
, но он не работает. Он гласит: p.StartInfo.Arguments = "/full groups /clean"
; и берет argTextBox и ничего не кладет.
Любые идеи о том, как добавить ввод текстового поля в существующий аргумент?
Спасибо, что работал отлично! –