Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Try
- Dim Xcel() As Process = Process.GetProcessesByName("EXCEL")
- For Each Process As Process In Xcel
- Process.Kill()
- Next
- Catch ex As Exception
- End Try
- End Sub
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Try
- For Each TaskManager As Process In Process.GetProcesses
- ListBox1.Items.Add(TaskManager.ProcessName)
- ListBox2.Items.Add(TaskManager.Id)
- Next
- Catch ex As Exception
- MessageBox.Show("Không Thể Hiển Thị Process Manager", "Thông Báo")
- End Try
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Try
- Process.GetProcessById(ListBox2.Text).Kill()
- Catch ex As Exception
- End Try
- End Sub
- Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
- ListBox2.SelectedIndex = ListBox1.SelectedIndex
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement