0

Assume that I execute a program with ProcessStartInfo:

        ProcessStartInfo startInfo = new ProcessStartInfo();
        startInfo.FileName = @"program"; 
        startInfo.Arguments = "start";
        Process.Start(startInfo);

During execution, the program is asking for some input from the user. How can I provide that input from C#?

Thanks in advance.

Maxim Mayers
  • 185
  • 2
  • 6

1 Answers1

0

If you know the arguments that should be given to the process, before starting it, you should change your (second) application so that it uses arguments in the main. Explanation can be found here.

If you still want the possibility to enter manually data while the process is running (when it is started manually) you could look for these arguments and when they are not present, ask them to the user instead of returning the application and stopping.

Bob Claerhout
  • 781
  • 5
  • 24