Home > Net >  Created on access to redirect the output of the console program
Created on access to redirect the output of the console program

Time:04-26

Through redirection can create console program for the output of the console program itself is not the output display content, have no way to restore the console output or not redirected access to console output content?
Attach the key to redirect code:
Process. StartInfo. CreateNoWindow=false;//show the console window
Process. StartInfo. UseShellExecute=false;
Process. StartInfo. RedirectStandardInput=true;//to redirect input
Process. StartInfo. RedirectStandardOutput=true;//redirecting output
Process. StartInfo. RedirectStandardError=true;//a redirect error output


  •  Tags:  
  • C#
  • Related