Is there a way to execute the following command through C#?
.\binary.exe < input > output
I am trying to use System.Diagnostics.Process but I was wondering if there is a direct exec style command in C#. Any suggestions?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not directly, but you can redirect output from a console stream (as you may have figured out, considering you’re trying to use the Process class), as noted here on MSDN: http://msdn.microsoft.com/en-us/library/system.diagnostics.process.standardoutput.aspx
There is also an example here on SO: Redirect console output to textbox in separate program
Wrap that into your own class and it will basically become an “exec” style command.