Public Class Form1
    Private PerCounter As System.Diagnostics.PerformanceCounter
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        PerCounter = New System.Diagnostics.PerformanceCounter
        PerCounter.CategoryName = "Processor"
        PerCounter.CounterName = "% Processor Time"
        PerCounter.InstanceName = "_Total"
        Timer1.Start()
        '/////////////////////////////////////////////////////////////////////////////////////////////////////////////'
        Процессы()
    End Sub
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Dim i As Integer = Integer.Parse(Format(PerCounter.NextValue, "##0"))
        Label2.Text = "Загрузка ЦП: " & i & " %"
    End Sub
    Private Sub ProccesKill_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProccesKill.Click
        If ListBox1.SelectedItem = Nothing Then
            MsgBox("Выбери процесс")
        Else
            Process.GetProcessesByName(ListBox1.SelectedItem)(0).Kill() : Процессы()
        End If
    End Sub
    Sub Процессы()
        ListBox1.Items.Clear()
        Dim fileName As String
        fileName = My.Computer.FileSystem.GetTempFileName()
        Dim РеальныеПроцессы() As Process = Process.GetProcesses
        Dim РазрешенныеПроцессы() As String = IO.File.ReadAllLines(fileName, System.Text.Encoding.GetEncoding(1251))
        Dim ТакойПроцессЕсть As Boolean
        For Each РеальныйПроцесс As Process In РеальныеПроцессы
            ТакойПроцессЕсть = False
            For Each РазрешенныйПроцесс As String In РазрешенныеПроцессы
                If РеальныйПроцесс.ProcessName = РазрешенныйПроцесс Then
                    ТакойПроцессЕсть = True
                End If
            Next
            If ТакойПроцессЕсть = False Then ListBox1.Items.Add(РеальныйПроцесс.ProcessName) : Label1.Text = "Процессов: " & ListBox1.Items.Count
        Next
    End Sub
    Private Sub ProcessDirectory_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProcessDirectory.Click
        If ListBox1.SelectedItem = Nothing Then
            MsgBox("Выбери процесс")
        Else
            Dim Path As Process = Process.GetProcessesByName(ListBox1.SelectedItem)(0)
            Dim Ph As String = Path.MainModule.FileName
            Process.Start(Replace(Ph, ListBox1.SelectedItem & ".exe", ""))
        End If
    End Sub
    Private Sub ProcessRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProcessRefresh.Click
        Процессы()
    End Sub
End Class
