2

問題があります. 2 番目のプロセスの後, 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();
4

1 に答える 1