[VB.Net]Kill a process 03-26-2011, 05:16 PM
#1
Function:
Usage:
I thought i share cause this is a snippet that should be close to your hand every time you want to use it.
Credits go to VBForums
Code:
''' <summary>
''' Kills a process which is selected.
''' </summary>
''' <param name="ProcessName">The process you want killed.</param>
''' <remarks></remarks>
Public Function KillProcess(ByRef ProcessName As String)
Dim RunningProcess As System.Diagnostics.Process = Process.GetProcessesByName(ProcessName)(0)
RunningProcess.Kill()
Return RunningProcess
End FunctionUsage:
Code:
KillProcess("explorer")
KillProcess("notepad")I thought i share cause this is a snippet that should be close to your hand every time you want to use it.
Credits go to VBForums
Pierce the life fibers with your drill.




![[+]](https://sinister.li/images/modern/collapse_collapsed.png)
..this is seriously useful..btw the ' ' ' are they single lined comments?
![[Image: R1bYlfT.gif]](http://i.imgur.com/R1bYlfT.gif)