语言

Process.Signal(PosixSignal) 方法

定义

将信号发送到关联的进程。

public:
 bool Signal(System::Runtime::InteropServices::PosixSignal signal);
[System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public bool Signal(System.Runtime.InteropServices.PosixSignal signal);
[<System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
member this.Signal : System.Runtime.InteropServices.PosixSignal -> bool
Public Function Signal (signal As PosixSignal) As Boolean

参数

signal
PosixSignal

要发送的信号。

返回

如果信号已成功发送,则为 如果进程已退出或不再存在且未传递信号,则为 。

属性

例外

没有与此对象关联的进程,或者进程句柄无效。

进程对象已被释放。

此过程位于远程计算机上。

当前平台或指定的信号不受支持。

无法发送信号。

注解

在Windows上,仅SIGKILL受支持,并发送它将终止进程。 进程句柄必须具有 PROCESS_TERMINATE 访问权限。

适用于