I have a piece of code: It is to kill a process.
It was working fine when i first started on my project on framework 4.5. Then i switched target framework to 2.0 and i got an error:
![]()
I tested it and it seems that it only works on frame work 3.5 +
How can i fix this error? I cant afford to have framework 4.5 dependency on my programs.
Code:
Dim num As Integer = 1
Do Until num = 5
Dim proc = Process.GetProcessesByName("notepad")
For i As Integer = 0 To proc.Count - 1
proc(i).CloseMainWindow()
Next i
num = num + 1
If num = 5 Then
num = 3
End If
Loop
I tested it and it seems that it only works on frame work 3.5 +
How can i fix this error? I cant afford to have framework 4.5 dependency on my programs.