[Mono-list] StandardOutput rediresd

PChot pchott at gmail.com
Sun Mar 18 17:24:34 EDT 2007


hi all

i'm trying to call simple "ls" proces in linux. In than want somehot to
redirect output to string. T tried many options bus seems that none worked.
Here is some code that i used and it doesnt work.

System.Diagnostics.Process Process3;
Process3 = new System.Diagnostics.Process();
Process3.StartInfo.UseShellExecute = false;
Process3.StartInfo.RedirectStandardOutput = true;
Process3 = System.Diagnostics.Process.Start("ls -lah");

string output = Process3.StandardOutput.ReadToEnd();
Process3.WaitForExit();
Process3.Close();


Does even work Output redirect in mono? What did i do wrong?

Thx for answer,

PChott

-- 
Macs are for those who don't want to know why their computer works.
Linux is for those who want to know why their computer works.
DOS is for those who want to know why their computer doesn't work.
Windows is for those who don't want to know why their computer doesn't work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20070318/87047d49/attachment.html 


More information about the Mono-list mailing list