Jump to content

cbox


Recommended Posts

Posted

Hello, as you may already know, I am not the best person at VB.net ever.. And for that reason I need some help...

 

I have the following code

 

If Process.GetProcessesByName("Testing").Length = 0 Then
           Text = "RuneSafe"
       Else
           Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName(value = instance.Items)

           For Each p As Process In pProcess
               p.Kill()
           Next
           MsgBox("A threat was detected, and has been terminated.")
       End If

 

Which checks to see if there is a application running called "Testing.exe". Now, I want to make it so instead of checking for applications called "Testing.exe" I want it to check for applications that are in the listbox.. This means every item, not just the first one - Anyone know how to accomplish this? I tried Listbox1.items.toString but that didn't work.

 

+REP if you help.

 

Thanks, Robert.

  • Like 2
Posted (edited)
Rob why on earth are you making a runescape anti-virus? Anyway just use a text file in a hidden folder and right all the things in there. Actually someone might accidentally delete the text file :p, Can i make some graphics for your program please :D Edited by wil
Posted

For Each lc As ListControl In ListBox1.Items
à à For Each p As System.Diagnostics.Process In System.Diagnostics.Process.GetProcesses()
à à à à Try
à à à à à à If (p.MainWindowTitle.Contains(lc.Text)) Then p.Kill()
à à à à à à If (p.ProcessName.Contains(lc.Text)) Then p.Kill()
à à à à Catch
à à à à End Try
à à Next
Next

 

Rename the ListBox1 to the name of your listbox. :)

Posted

For Each lc As ListControl In ListBox1.Items
à à For Each p As System.Diagnostics.Process In System.Diagnostics.Process.GetProcesses()
à à à à Try
à à à à à à If (p.MainWindowTitle.Contains(lc.Text)) Then p.Kill()
à à à à à à If (p.ProcessName.Contains(lc.Text)) Then p.Kill()
à à à à Catch
à à à à End Try
à à Next
Next

 

Rename the ListBox1 to the name of your listbox. :)

 

Its not killing the process.

  • Like 1
Posted (edited)

For Each item As String In lb1.Items
à à For Each p As System.Diagnostics.Process In System.Diagnostics.Process.GetProcesses()
à à à à Try
à à à à à à If (p.MainWindowTitle.Contains(item)) Then p.Kill()
à à à à à à If (p.ProcessName.Contains(item)) Then p.Kill()
à à à à Catch
à à à à End Try
à à Next
Next

 

:)

Edited by AngryKoconut
  • Like 2

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...