do { if (!proc.HasExited) { proc.Refresh(); if (proc.HasExited) { goto Finish; } if (proc.Responding) { Console.WriteLine("Process is responding..."); } else { Console.WriteLine("Process is not responding..."); } } } while (!proc.WaitForExit(500)); if (proc.HasExited) { goto Finish; } Finish:;