This is the code I have implemented to check whether the process is running or not.
using System.Diagnostics;
class Program
{
static void Main(string[] args)
{
//TODO
}
public static bool IsProcessUp(string name)
{
foreach (Process status in Process.GetProcesses())
{
if (status.ProcessName.Contains(name))
{
return true;
}
}
return false;
}
}
}
I want to read the names of the processes from appsettings file.
Can someone please let me know how can I do it.
Thankyou.