Sprache

Process.TryGetProcessById(Int32, Process) Methode

Definition

Versucht, eine Process Instanz für einen vorhandenen Prozess mit der angegebenen Prozess-ID abzurufen.

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

Parameter

processId
Int32

Die Prozess-ID des zu findenden Prozesses.

process
Process

Wenn diese Methode zurückgegeben wird true, enthält sie eine Process Darstellung des vorhandenen Prozesses; andernfalls null.

Gibt zurück

truewenn der Prozess gefunden wurde; andernfalls . false

Attribute

Ausnahmen

processId ist kleiner oder gleich Null.

Gilt für: