Language

Process.TryGetProcessById(Int32, Process) メソッド

定義

指定したプロセス ID を持つ既存のプロセスの Process インスタンスの取得を試みます。

public:
 static bool TryGetProcessById(int processId, [Runtime::InteropServices::Out] System::Diagnostics::Process ^ % process);
[System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public static bool TryGetProcessById(int processId, out System.Diagnostics.Process? process);
[<System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
static member TryGetProcessById : int * Process -> bool
Public Shared Function TryGetProcessById (processId As Integer, ByRef process As Process) As Boolean

パラメーター

processId
Int32

検索するプロセスのプロセス ID。

process
Process

このメソッドが trueを返す場合は、既存のプロセスを表す Process が含まれます。それ以外の場合は null。

返品

true プロセスが見つかった場合。それ以外の場合は false。

属性

例外

processId が 0 以下です。

適用対象