我有一个问题,在第二个进程之后会将 textbox.text 清理干净,但是我该如何设置它。
(不要清理文本框)
process1.StartInfo.FileName = ("cmd.exe");
process1.StartInfo.Arguments = "/C cscript slmgr.vbs /dli | FINDSTR /i \"Name\"";
process1.StartInfo.UseShellExecute = false;
process1.StartInfo.RedirectStandardOutput = true;
process1.StartInfo.RedirectStandardInput = true;
process1.StartInfo.CreateNoWindow = true;
process1.Start();
process1.WaitForExit();
string sOutput = process1.StandardOutput.ReadToEnd();
textBox1.Text = sOutput;
process1.Close();
process2.StartInfo.FileName = ("cmd.exe");
process2.StartInfo.Arguments = "/C cscript slmgr.vbs /dli | FINDSTR /i \"License Status\"";
process2.StartInfo.UseShellExecute = false;
process2.StartInfo.RedirectStandardOutput = true;
process2.StartInfo.RedirectStandardInput = true;
process2.StartInfo.CreateNoWindow = true;
process2.Start();
process2.WaitForExit();
string sOutput1 = process2.StandardOutput.ReadToEnd();
textBox1.Text = sOutput1;
process2.Close();