ixGAMEOVERxixx Posted September 4, 2009 Report Posted September 4, 2009 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. 2
wil Posted September 4, 2009 Report Posted September 4, 2009 (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 , Can i make some graphics for your program please Edited September 4, 2009 by wil
AngryKoconut Posted September 4, 2009 Report Posted September 4, 2009 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.
ixGAMEOVERxixx Posted September 4, 2009 Author Report Posted September 4, 2009 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. 1
AngryKoconut Posted September 4, 2009 Report Posted September 4, 2009 (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 September 4, 2009 by AngryKoconut 2
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now