I want to programmatically verify the status of an application to see if it has crashed or stopped. I know how to see if the process exists in C# but can I also see if it is "Not responding"?
See Question&Answers more detail:osI want to programmatically verify the status of an application to see if it has crashed or stopped. I know how to see if the process exists in C# but can I also see if it is "Not responding"?
See Question&Answers more detail:osEverything you need is in System.Diagnostics, for example: to check if a process is responding.
using System;
using System.Diagnostics;
namespace ProcessStatus
{
class Program
{
static void Main(string[] args)
{
Process[] processes = Process.GetProcesses();
foreach (Process process in processes)
{
Console.WriteLine("Process Name: {0}, Responding: {1}", process.ProcessName, process.Responding);
}
Console.Write("press enter");
Console.ReadLine();
}
}
}