我正在尝试使用VS2015社区列出正在运行的进程,但是它给出了win32异常的任何线索,这里有什么问题? 我的目标是检测和报告由第三方启动的空闲线程的子进程的应用程序名称是不同的!
imports System
imports system.diagnostics
imports system.componentmodel
Try
Dim ps() As Process
ps = System.Diagnostics.Process.GetProcesses()
For Each mp As Process In ps
Debug.WriteLine(mp.MainModule.ToString)
Dim li As New ListViewItem
li = Me.ListView1.Items.Add("TEST")
li.EnsureVisible()
Next
Catch ex As Exception
Debug.Print(ex.Message.ToString)
End Try
错误
System.Diagnostics.ProcessModule (iusb3mon.exe)
System.Diagnostics.ProcessModule (NOTEPAD.EXE)
Exception thrown: 'System.ComponentModel.Win32Exception' in System.dll
Access is denied