Kill Process if in both listboxA and ListboxB Posted by: MXTECH in Untagged  on
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

Trackback(0)
feed1 Comments
DARGUETA
August 14, 2008
Votes: +0

You're double-declaring myProcess. What exactly is wrong with your approach? Just change the timer delay to the smallest value possible.

report abuse
vote down
vote up

Write comment
 
 
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger
 

security image
Write the displayed characters


busy