C# Monitor Programs Periodically Based on PID
- by ThaKidd
Thank you in advance for you ideas and input.
I would like to periodically check to see if a third party program is currently running on a user's system from my program. I am currently launching the program as follows in C#:
String plinkConString = ""; // my connection string
Process plink = Process.Start(utilityPath + @"\putty.exe", plinkConString);
int plinkProcessId = plink.Id;
I launch the program and grab its pid in a Windows environment. As Putty/PLink may disconnect from its SSH server at some point and close, what is the best way to monitor how this process is doing in code?
Is there a better way to launch this program to monitor its success or failure?