akhirnya saya menambah koleksi dari program-program VB.Net yang saya
pelajari. Hari ini saya menyajikan tentang cara membuat task manager dan
fungsi untuk mematikan salah satu proses...
Silahkan cek TKP
Silahkan cek TKP
Pertama seperti biasa kita membuat sebuah form. dimana form ini memuat:
2 command button
1 list box
button 1 untuk mematikan proses yang sedang berjalan
button 2 untuk keluar dari form
list box untuk melihat daftar list proses yang sedang berjalan
langsung saja untuk codingnya.
untuk yang mau copas coding silahkan di bawa ini :
<br />
Imports System.Diagnostics.Process<br />
Public Class Form1<br />
Inherits System.Windows.Forms.Form<br />
Dim proces As Process<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
'On Error Goto Fix<br />
'dim Str As String=InputBox("Enter process to kill",""Process Killer","Killer")<br />
For Each proces In GetProcesses()<br />
'If proces.ProcessName = Str.ErrorToString Or Process.ProcessName="smss" Then<br />
' proces.Kill()<br />
'End If<br />
Me.ListBox1.Items.Add(proces.ProcessName)<br />
Next<br />
'Fix<br />
'End<br />
End Sub<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
'MsgBox(Me.ListBox1.SelectedItem)<br />
For Each proces In GetProcesses()<br />
If proces.ProcessName = Me.ListBox1.SelectedItem Then<br />
proces.Kill()<br />
End If<br />
Next<br />
Me.ListBox1.Items.RemoveAt(Me.ListBox1.SelectedIndex)<br />
End Sub<br />
<br />
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click<br />
End<br />
End Sub<br />
End Class<br />
Imports System.Diagnostics.Process<br />
Public Class Form1<br />
Inherits System.Windows.Forms.Form<br />
Dim proces As Process<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
'On Error Goto Fix<br />
'dim Str As String=InputBox("Enter process to kill",""Process Killer","Killer")<br />
For Each proces In GetProcesses()<br />
'If proces.ProcessName = Str.ErrorToString Or Process.ProcessName="smss" Then<br />
' proces.Kill()<br />
'End If<br />
Me.ListBox1.Items.Add(proces.ProcessName)<br />
Next<br />
'Fix<br />
'End<br />
End Sub<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
'MsgBox(Me.ListBox1.SelectedItem)<br />
For Each proces In GetProcesses()<br />
If proces.ProcessName = Me.ListBox1.SelectedItem Then<br />
proces.Kill()<br />
End If<br />
Next<br />
Me.ListBox1.Items.RemoveAt(Me.ListBox1.SelectedIndex)<br />
End Sub<br />
<br />
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click<br />
End<br />
End Sub<br />
End Class<br />
Sign up here with your email
ConversionConversion EmoticonEmoticon