-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtask manager.vb
37 lines (32 loc) · 1.67 KB
/
task manager.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Public Class task_manager
Private Sub task_manager_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Process As New Process()
Dim Count As Integer = 0
ListView1.Items.Clear()
For Each Process In Process.GetProcesses(My.Computer.Name)
On Error Resume Next
ListView1.Items.Add(Process.ProcessName)
ListView1.Items(Count).SubItems.Add(FormatNumber(Math.Round(Process.PrivateMemorySize64 / 1024), 0))
ListView1.Items(Count).SubItems.Add(Process.Responding)
ListView1.Items(Count).SubItems.Add(Process.StartTime.ToString.Trim)
ListView1.Items(Count).SubItems.Add(Process.Id)
Count += 1
Next
ToolStripStatusLabel1.Text = "Processes: " & ListView1.Items.Count
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
For Each Process As ListViewItem In ListView1.SelectedItems
System.Diagnostics.Process.GetProcessById(Process.SubItems(4).Text).Kill()
Next
task_manager_Load(Nothing, Nothing)
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
task_manager_Load(Nothing, Nothing)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
For Each Process As ListViewItem In ListView1.SelectedItems
System.Diagnostics.Process.GetProcessById(Process.SubItems(4).Text).Kill()
Next
task_manager_Load(Nothing, Nothing)
End Sub
End Class