Sprog

ProcessStartInfo.StandardOutputHandle Property

Definition

Gets or sets a SafeFileHandle to use as the standard output of the child process.

public:
 property Microsoft::Win32::SafeHandles::SafeFileHandle ^ StandardOutputHandle { Microsoft::Win32::SafeHandles::SafeFileHandle ^ get(); void set(Microsoft::Win32::SafeHandles::SafeFileHandle ^ value); };
public Microsoft.Win32.SafeHandles.SafeFileHandle? StandardOutputHandle { get; set; }
member this.StandardOutputHandle : Microsoft.Win32.SafeHandles.SafeFileHandle with get, set
Public Property StandardOutputHandle As SafeFileHandle

Property Value

A SafeFileHandle to use as the standard output handle of the child process, or null to use the default behavior.

Remarks

The handle doesn't need to be inheritable; the runtime duplicates it as inheritable if needed.

Use CreateAnonymousPipe to create a pair of connected pipe handles, OpenHandle to open a file handle, OpenNullHandle to discard output, or OpenStandardOutputHandle to inherit the parent's standard output.

When this property is null and RedirectStandardOutput is false, the process normally inherits the parent's standard output. However, if StartDetached is true or the process is started with StartAndForget(ProcessStartInfo), standard output is redirected to the null device instead.

It's recommended to dispose the handle right after starting the process.

When this property is not null, RedirectStandardOutput and UseShellExecute must both be false.

Applies to