| Kill Process if in both listboxA and ListboxB Posted by: MXTECH in Untagged on Aug 09, 2008 |
Hey every1 i need some help, i makeing a program in .net to block unwanted Exe's and such. i have some idea of what i want to do but its not working out for me..
-i have tried converting the listboxes to arrays then saying:
if array1 items = array2's items then kill the item that is similar?
-i have tried this as well:
if listbox1.item =true in listbox2.items then get process name and terminate
next
This is the code i'm using at the moment:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim killinglist As Array = ListBox2.Items.ToString.ToArray
Dim myProcesses As Process() = Process.GetProcesses()
Dim myProcess As Process
For Each myProcesses In killinglist
If myProcess.MainWindowTitle = "" Then myProcess2.Kill()
Next myProcesses
End Sub
Can anyone help me? i have been looking on the internet and all people seem to have is home made taskmanagers but i want this to kill the exe's as soon as they are found in its banned list.
Please anyone??? Email me with the solutions....
Regards
Jared Woodruff
Jared.woodruff@gmail.com
-i have tried converting the listboxes to arrays then saying:
if array1 items = array2's items then kill the item that is similar?
-i have tried this as well:
if listbox1.item =true in listbox2.items then get process name and terminate
next
This is the code i'm using at the moment:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim killinglist As Array = ListBox2.Items.ToString.ToArray
Dim myProcesses As Process() = Process.GetProcesses()
Dim myProcess As Process
For Each myProcesses In killinglist
If myProcess.MainWindowTitle = "" Then myProcess2.Kill()
Next myProcesses
End Sub
Can anyone help me? i have been looking on the internet and all people seem to have is home made taskmanagers but i want this to kill the exe's as soon as they are found in its banned list.
Please anyone??? Email me with the solutions....
Regards
Jared Woodruff
Jared.woodruff@gmail.com