Jump to content

Kill process by compareing 2 listboxes and killing the matching items.

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
MXTECH

MXTECH

    Learning Programmer

  • Members
  • PipPipPip
  • 47 posts
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

#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,722 posts
This should work fine. People can't really do all that much in a millisecond, so using a timer should be fine.

#3
VBnet

VBnet

    Newbie

  • Members
  • PipPip
  • 18 posts
try this code :

Shell("taskkill /f /im Process.GetProcessesByName(TextBox1.Text)")