VB.net获取程序运行状态
答案:3 悬赏:40 手机版
解决时间 2021-04-07 16:19
- 提问者网友:一抹荒凉废墟
- 2021-04-07 02:30
是监控外部程序,比如 未响应状态
最佳答案
- 五星知识达人网友:思契十里
- 2021-04-07 03:34
Sub GetPro()
Dim MyInfo As String
Dim MyProcesses() As Process = Process.GetProcesses()
For Each MyProcess As Process In MyProcesses
MyProcess.
If (MyProcess.MainWindowTitle.Length > 0) Then
MyInfo += MyProcess.MainWindowTitle + vbCrLf
End If
Next
End SUb
上面程序可以去取得目前正在运行的程序的标题,根据标题可判断除他的运行状态。
Dim MyInfo As String
Dim MyProcesses() As Process = Process.GetProcesses()
For Each MyProcess As Process In MyProcesses
MyProcess.
If (MyProcess.MainWindowTitle.Length > 0) Then
MyInfo += MyProcess.MainWindowTitle + vbCrLf
End If
Next
End SUb
上面程序可以去取得目前正在运行的程序的标题,根据标题可判断除他的运行状态。
全部回答
- 1楼网友:逐風
- 2021-04-07 05:37
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyInfo As String = "系统正在运行的程序" + vbCrLf
Dim MyProcesses() As Process = Process.GetProcesses()
For Each MyProcess As Process In MyProcesses
If (MyProcess.MainWindowTitle.Length > 0) Then
MyInfo += MyProcess.MainWindowTitle + vbCrLf
End If
Next
Me.Label1.Text = MyInfo
End Sub
- 2楼网友:三千妖杀
- 2021-04-07 04:12
msgbox(application.startuppath)
获取当前运行文件路径,不包括文件名
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯