14-08-14, 10:14 AM
(14-08-14, 10:06 AM)silverlight كتب : Private Sub KillProcess (processName as String )الله يعطيك العافيه بس وين احدد البرنامج الي ابغه يطفي
For Each currentProcess As Process In System.Diagnostics.Process.GetProcessesByName("processName ")
Try
currentProcess.Kill()
' possibly with a timeout
currentProcess.WaitForExit()
Catch winException As Win32Exception ' process was terminating or can't be terminated ...... deal with it
' do something
Catch invalidException As InvalidOperationException ' process has already exited ...... might be able to let this one go
Exit sub
End Try
Next
End Sub

