Process.GetProcessByNameAsync
Description
Gets the ProcessInfo with the specified process name from the connected Control Room.
Signature [C#]
Task<ProcessInfo> GetProcessByNameAsync(string processName)
Properties
Input
Property | Description |
---|---|
processName | Specify the process Name for which the information has to be retrieved. |
Output
Property | Description |
---|---|
Task<ProcessInfo> | Returns the information of a process using its Name. |
Remarks
Use GetProcessByNameAsync API to get the ProcessInfo with the specified process name from the connected Control Room.
Example
C#
public void GetProcessByName()
{
IControlRoomContext context = LoginControlRoom("RegularBuild", "BasicAuth");
string processName = "Create_And_Delete_File";
ProcessInfo actualProcess = Task.Run(() => context.Processes.GetProcessByNameAsync(processName)).Result;
Console.WriteLine("Process Name: " + process.Name);
}
C#
public IControlRoomContext LoginControlRoom()
{
IControlRoomContext context;
string connectionString;
connectionString = "ServerUrl=https://demo.onnitellibuddies.com;UserName=demoadmin;Password=password";
context = new ControlRoomContext(connectionString);
context.Open();
return context;
}