What's Here?
- Members: 340,150
- Replies: 920,522
- Topics: 154,949
- Snippets: 4,855
- Tutorials: 1,257
- Total Online: 3,860
- Members: 117
- Guests: 3,743
|
|
Submitted By:
RodgerB
|
|
Rating:
  
|
| Views: 6,734 |
Language: VB.NET |
| Last Modified: December 11, 2007 |
Instructions:
1) Copy and paste the subroutine into a class.
2) Read how to call the subroutine. |
Snippet
''' <summary>
''' Loops through the processes and kills a process if it is not wanted.
''' </summary>
''' <param name="strProcessToKill">The process you want killed.</param>
''' <remarks></remarks>
Public Sub killProcess(ByRef strProcessToKill As String)
Dim proc() As Process = Process.GetProcesses
For i As Integer = 0 To proc.GetUpperBound(0)
If proc(i).ProcessName = strProcessToKill Then
proc(i).Kill()
End If
Next
End Sub
' Example Usage.
killProcess("notepad")
Copy & Paste
|
|
|
Be Social
Reference Sheets
Bye Bye Ads
Monthly Drawing
Top Contributors
Top 10 Kudos This Month
|