Public Sub KillProcessFromMemorry()
'注意进程名称的大小写
Dim procName As String = "EXCEL"
For Each proc In Process.GetProcesses
If proc.ProcessName Like procName Then
Console.WriteLine("'{0}' is running, do you want to quit?(y, n)", procName)
If Console.ReadKey.Key = ConsoleKey.Y Then
proc.Kill()
End If
End If
Next
End Sub
追问怎么放在按钮里?
追答放在按钮单击事件里面。