Enum
enum ProcessRedirect
public enum ProcessRedirect {
| Inherit
| Pipe
| FromFile(File)
| Discard
}
Description: Sets the redirection mode of the subprocess standard stream when a process is created.
Discard
Discard
Description: Constructs an enumeration instance of standard stream redirection, indicating that the standard stream of the subprocess is discarded. In this mode, the standard stream attributes cannot be read or written.
FromFile(File)
FromFile(File)
Description: Constructs an enumeration instance of standard stream redirection, indicating that the standard stream of the subprocess is redirected to a specified file. The redirected standard input stream is read from a specified file, and the redirected standard output stream or standard error stream is written to the specified file. Ensure that the redirection file exists and is not closed. Otherwise, redirection is not allowed. In this mode, the standard stream attributes cannot be read or written. The File parameter specifies the file instance that exists and is not closed. When a subprocess is created, the standard stream is redirected to the specified file.
Inherit
Inherit
Description: Constructs an enumeration instance of standard stream redirection, indicating that the standard stream of the subprocess inherits the standard stream of the current process. In this mode, the standard stream attributes cannot be read or written.
Pipe
Pipe
Description: Constructs an enumeration instance of standard stream redirection, indicating that the standard stream of the subprocess is redirected to a pipe and connected to the current process through the pipe. The redirected standard input stream can write data to the subprocess through the pipe, and the redirected standard output stream or standard error stream can read the output result of the subprocess through the pipe. In this mode, data can be read or written through the standard stream attributes.