Process.TryGetProcessById(Int32, Process) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
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.