7zip, console process and read StandardOutput



I start process 7zip (http://www.7-zip.org/):

myProc.StartInfo.FileName = Application.StartupPath + @"\7z.exe";
myProc.StartInfo.Arguments = "a -mx9 -y -r " + pathwhat + " " pathwhere
myProc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
myProc.StartInfo.CreateNoWindow = true;
myProc.StartInfo.UseShellExecute = false;
myProc.StartInfo.RedirectStandardOutput = true;

and in timer:
stream = myProc.StandardOutput.ReadLine()
in stream I have everything without current ammount of percent which is show
in console window.
7zip in console looks that:
Compressing h:\x:\1.a
Compressing h:\x:\2.a
Compressing h:\x:\3.a 33% -> this ist last line at this moment

I need to have a current amount of percent "xx%" in stream which shows in
process console window in the last line (always three last characters).

Can anybody help me ?



Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question