语言

ProcessStartInfo.StandardErrorHandle 属性

定义

获取或设置一个 SafeFileHandle 用作子进程的标准错误。

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

属性值

一个 SafeFileHandle 用作子进程的标准错误句柄,或使用 null 默认行为。

注解

句柄不需要可继承;运行时根据需要将其复制为可继承。

用于 CreateAnonymousPipe 创建一对连接的管道句柄、 OpenHandle 打开文件句柄、 OpenNullHandle 放弃错误输出或 OpenStandardErrorHandle 继承父级的标准错误。

当此属性是 null 且 RedirectStandardError 为 false此属性时,此过程通常继承父级的标准错误。 但是,如果是StartDetachedtrue或进程启动StartAndForget(ProcessStartInfo),则标准错误会改为重定向到 null 设备。

建议在启动进程后立即释放句柄。

如果此属性不是 null, RedirectStandardError 并且 UseShellExecute 必须两者都是 false。

适用于