currently I have a process that runs, but it requires the user to enter
y <return>
<return>
The code I am using is as follows
ProcessStartInfo psi = new ProcessStartInfo();
string exepath = Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).ToString();
Process proc = new Process();
psi.FileName = exepath + @"\lib\dnaml";
psi.RedirectStandardInput = true;
psi.Arguments = "y\r \r";
psi.UserShellExecute = true;
proc.StartInfo = psi;
proc.Start();
proc.WaitForExit();
I want to hard type these inputs in. Any suggestions? Thanks
The
Argumentsproperty corresponds to the command-line, not data entered via standard input.The
RedirectStandardInputproperty is part of the puzzle. Then you also need to write to the stream connected to theStandardInputproperty. Also note that standard input redirection is incompatible withShellExecute, it needsCreateProcessto work. So setUseShellExecute = false.