C# Windows Form .Net and DOS Console -


I have a windows form that executes the batch file. I want to transfer everything in my console to a panel in my panel, how can I do this? How can my dos console communicate with my windows form panel ???

Thanks

You can call dos or batch programs from your form application And can redirect the output to the string:

 using  (var p = new System.Diagnostics.Process ()) {p.StartInfo. UseShellExecute = false; P.StartInfo.RedirectStandardOutput = true; P.StartInfo.FileName = PathToBatchFile; P.StartInfo.Arguments = args; P. Start (); String o = p.StandardOutput.ReadToEnd (); P.WaitForExit (); }  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -