語言

ProcessStartInfo.KillOnParentExit 屬性

定義

取得或設定一個值,指示子程序在父程序退出時是否應終止。

public:
 property bool KillOnParentExit { bool get(); void set(bool value); };
[System.Runtime.Versioning.SupportedOSPlatform("android")]
[System.Runtime.Versioning.SupportedOSPlatform("linux")]
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public bool KillOnParentExit { get; set; }
[<System.Runtime.Versioning.SupportedOSPlatform("android")>]
[<System.Runtime.Versioning.SupportedOSPlatform("linux")>]
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
member this.KillOnParentExit : bool with get, set
Public Property KillOnParentExit As Boolean

屬性值

true當父程序退出時終止子程序;否則,。 false 預設值為 false。

屬性

備註

當此屬性設定為 true時,作業系統會在父程序退出時自動終止子程序,無論父程序是優雅退出還是當機。

此性質不能與 UseShellExecute 集合 true一起使用。

在Windows中,行為是透過帶有 JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE 標誌的工作物件來實作。

在 Linux 和 Android 上,這種行為是透過 prctl(PR_SET_PDEATHSIG).

適用於