Skip to main content
Version: Current

Process.GetProcessByNameAsync

Description​

Gets the ProcessInfo with the specified process name from the connected AI Command Center.

Signature [C#]​

Task<ProcessInfo> GetProcessByNameAsync(string processName);

Properties​

Input​

ParameterTypeRequired / defaultDescription
processNamestringRequiredSpecify the process Name for which the information has to be retrieved.

Output​

PropertyDescription
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 AI Command Center.

Example​

C#
public async Task GetProcessByName()
{
IControlRoomContext context = LoginControlRoom();
try
{
string processName = "Create_And_Delete_File";
ProcessInfo actualProcess = await context.Processes.GetProcessByNameAsync(processName);
Console.WriteLine("Process Name: " + actualProcess.Name);
}
finally
{
context.Close();
}
}
Connection helper
public IControlRoomContext LoginControlRoom()
{
string RequiredSetting(string name) => Environment.GetEnvironmentVariable(name) ?? throw new InvalidOperationException($"Set {name} before running this example.");
string serverUrl = RequiredSetting("INTELLIBUDDIES_SERVER_URL");
string userName = RequiredSetting("INTELLIBUDDIES_USERNAME");
string password = RequiredSetting("INTELLIBUDDIES_PASSWORD");
string connectionString = $"ServerUrl={serverUrl};UserName={userName};Password={password}";
IControlRoomContext context = new ControlRoomContext(connectionString);
context.Open();
return context;
}

See Get started for namespaces, configuration, and context cleanup, and SDK usage for error handling.