VB.NET Running Process List

The Process component is a useful tool for starting, stopping, controlling, and monitoring applications. The System.Diagnostics namespace provides classes that allow you to interact with system processes, event logs, and performance counters.

In addition to retrieving lists of running processes or viewing information about the process that currently has access to the processor, you can get detailed knowledge of process threads and modules both through the Process class itself.

The process component obtains information about a group of properties all at once. After the Process component has obtained information about one member of any group, it will cache the values for the other properties in that group and not obtain new information about the other members of the group until you call the Refresh method.

The following VB.NET program shows how to retrieve the process name and Memory Allocation of each process from a running system. Drag and drop a Button and ListBox control on your VB.NET Form, and copy and paste the following source code on button click event.

Imports System.Diagnostics

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim plist() As Process = Process.GetProcesses()

        For Each prs As Process In plist
            ListBox1.Items.Add(prs.ProcessName + "         (" + prs.PrivateMemorySize64.ToString() + ")")
    End Sub
End Class (C) 2021    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.
SiteMap  | Terms  | About