[Mono-list] StandardOutput rediresd
Juan C. Olivares
juancri at gmail.com
Sun Mar 18 18:41:50 EDT 2007
You are overwriting the "Process3" variable assigning it two times:
// First time
Process3 = new System.Diagnostics.Process();
// Second one
Process3 = System.Diagnostics.Process.Start ("ls -lah");
best regards
Juan C. Olivares
www.juancri.com
On 3/18/07, PChot <pchott at gmail.com > wrote:
>
> 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.
> _______________________________________________
> Mono-list maillist - Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20070318/180e39e4/attachment-0001.html
More information about the Mono-list
mailing list