Füge progressBar hinzu, um den Prozentsatz des Fortschritts eines Prozesses in c # anzuzeigen.

Dies ist Code über meinen Prozess:

StreamReader outputReader = null;
StreamReader errorReader = null;


       ProcessStartInfo processStartInfo = new ProcessStartInfo(......);
       processStartInfo.ErrorDialog = false;

       //Execute the process
        Process process = new Process();
        process.StartInfo = processStartInfo;
        bool processStarted = process.Start();

                     if (processStarted)
                        {
                        //Get the output stream
                        outputReader = process.StandardOutput;
                        errorReader = process.StandardError;


                        //Display the result
                        string displayText = "Output" + Environment.NewLine + "==============" + Environment.NewLine;
                        displayText += outputReader.ReadToEnd();
                        displayText += Environment.NewLine + Environment.NewLine + "==============" +
                                       Environment.NewLine;
                        displayText += errorReader.ReadToEnd();
                        // txtResult.Text = displayText;
                    }

Ich muss meinem Formular progressBar hinzufügen, um den Prozentsatz des Fortschritts für diesen Prozess zu berechnen, aber ich weiß nicht, wie.

Ich benutze Visual Studio 2012, Windows Form.

Antworten auf die Frage(2)

Ihre Antwort auf die Frage