Im working on a small virus removal application, and i have a piece of code to check if a process is running,
although, it doesn't seem to work.
The code is as follows:
ListView2.Items.Add(TimeOfDay + " - Starting Process Scanner") Dim Vir As Process() = Process.GetProcesses Dim a As Integer For a = 0 To Vir.Length - 1 Debug.WriteLine(Vir(a).ProcessName) If Strings.UCase(Vir(a).ProcessName) = Strings.UCase("rofl") Then ListView2.Items.Add(TimeOfDay + " - Virus Process Active") Button3.Enabled = True Else ListView2.Items.Add(TimeOfDay + " - No Virus Process Active") End If Next End Sub
The process name is "rofl.exe", i also had an application running with that process name.
Nothing happened with the process, allthough it jammed my listview full with "no virus process active"
Could anyone explain why this wont work, and point me in the right direction?
This post has been edited by eicar: 26 October 2009 - 03:56 PM