VB.net Kill() 彻底结束进程
Private Sub ProcessKill(ByVal myExcel As Excel.Application)
Dim p As New System.Diagnostics.Process
Dim inst As Process
Dim myProcess() As Process
myProcess = System.Diagnostics.Process.GetProcessesByName("EXCEL")
For Each inst In myProcess
'If inst.Handle.ToInt32 = myExcel.Hinstance Then
p = System.Diagnostics.Process.GetProcessById(inst.Id)
p.Kill()
'End If
Next
我想关闭当前使用的进程 myExcel
怎么判断它的位置呢?myExcel.Hwnd 与 inst.Handle.ToInt32 不相等。。。。。。。。。。。。