本文介绍了监视第三方控制台应用程序没有响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有控制台应用程序正在运行(第三方不是由我编写的),每次服务器出现问题时都会崩溃(我的控制也不受控制)。我正在尝试和未能编写监控控制台应用程序的应用程序。如果没有响应的杀戮&重新开始。杀戮与重启是很容易的部分,但当我尝试监控程序时,它说该过程响应好,但是Windows&表示程序已停止运行



I have console application running (Third party not written by me) which crashes everytime the server have problems (Out of my control also). I was trying & failing to write a application which monitors the Console Application & if non responsive kill & restart. The kill & restart is the easy part but when I try to monitor the program it says the process is responding Ok, but Windows & is stating the program has stopped running

Dim myProcesses() As Process
                   myProcesses = System.Diagnostics.Process.GetProcessesByName("ConsoleApplication1")
                   ' Tests the Responding property for a True return value.
                   If myProcesses(0).Responding Then
                       lbl_Status.Text = "Process is OK"
                   Else
                       ' Forces the process to close if the Responding value is False.
                       myProcesses(0).Kill()
                       System.Diagnostics.Process.Start(txt_Process.Text)
                       lbl_Status.Text = "Process is Crashed"
                   End If





我完全迷路了?



不理想,但任何理想或方向?



I am totally lost?

Not ideal but any ideal or directions?

推荐答案


这篇关于监视第三方控制台应用程序没有响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 16:03