Of course, What we need first is to include the most important namespace.
Imports System.Diagnostics
Now to show the list of all running process in windows, use the following codes.
Dim psList() As Process
Try
psList = Process.GetProcesses()
For Each p As Process In psList
Console.WriteLine(p.Id.ToString() + " " + p.ProcessName)
Next p
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
Console.ReadKey()
The result should look like this.

You can download the complete sample Visual Studio 2008 project here.
For more coding tips & tricks, subscribe now.
0 comments:
Post a Comment