Langue

Process.TryGetProcessById(Int32, Process) Méthode

Définition

Tente d’obtenir une Process instance d’un processus existant avec l’ID de processus spécifié.

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

Paramètres

processId
Int32

ID de processus du processus à rechercher.

process
Process

Lorsque cette méthode retourne true, contient un Process représentant le processus existant ; sinon, null.

Retours

true si le processus a été trouvé ; sinon, false.

Attributs

Exceptions

processId est inférieur ou égal à zéro.

S’applique à