Class ProcessUtils
Implements
Inherited Members
Namespace: LemonEdge.DesktopTools.Debugger.Utils
Assembly: LemonEdge.DesktopTools.dll
Syntax
public class ProcessUtils : IProcessUtils
Constructors
ProcessUtils(IProcessControlWrapper)
Declaration
public ProcessUtils(IProcessControlWrapper processControlWrapper)
Parameters
Type | Name | Description |
---|---|---|
IProcessControlWrapper | processControlWrapper |
Methods
GetProcessIdAsync(string, int)
Retrieves the process ID based on the specified process name.
Declaration
public Task<int> GetProcessIdAsync(string processName, int attempt = 1)
Parameters
Type | Name | Description |
---|---|---|
string | processName | The name of the process for which to retrieve the ID. |
int | attempt | Optional parameter specifying the attempt number (default is 1). |
Returns
Type | Description |
---|---|
Task<int> | The process ID if found; otherwise, a default value (-1). |