SolvedImports System.Diagnostics | GetProcesses

Posts 1–9 of 9 · Page 1 of 1
Imports System.Diagnostics | GetProcesses
Short and Simple.

I have The "Imports System.Diagnostics" Namespace but yet Process.GetProcesses doesn't work

Anyone Help me please?

Code:
Imports System.Diagnostics
Public Class Process



    Private Sub NsButton2_Click(sender As Object, e As EventArgs) Handles NsButton2.Click
        For Each OneProcess As Process In Process.GetProcesses
            ListBox1.Items.Add(OneProcess.ProcessName)
        Next
    End Sub
End Class
Not sure if the brackets are missing or if it's ok in vb.net lol
Use the cycle deltan to get all the processes...

First of all, clear the listbox if the user want to get again the processes:
Code:
        ListBox1.Items.Clear()
get visible and invisible processes:
Code:
        For Each all As Process In Process.GetProcesses
            If all.MainWindowTitle = String.Empty = False Then
                ListBox1.Items.Add(all.ProcessName & " - Visible") '< delete all this to get just the invisible processes
            Else
                ListBox1.Items.Add(all.ProcessName & " - Not visible") '< delete all this to get just the visible processes
            End If
        Next
get all the processes:
Code:
        For Each all As Process In Process.GetProcesses
                ListBox1.Items.Add(all.ProcessName)
        Next
you don't need to import System.Diagnostics namespaces
Quote Originally Posted by Raydenman View Post
Use the cycle deltan to get all the processes...

First of all, clear the listbox if the user want to get again the processes:
Code:
        ListBox1.Items.Clear()
get visible and invisible processes:
Code:
        For Each all As Process In Process.GetProcesses
            If all.MainWindowTitle = String.Empty = False Then
                ListBox1.Items.Add(all.ProcessName & " - Visible") '< delete all this to get just the invisible processes
            Else
                ListBox1.Items.Add(all.ProcessName & " - Not visible") '< delete all this to get just the visible processes
            End If
        Next
get all the processes:
Code:
        For Each all As Process In Process.GetProcesses
                ListBox1.Items.Add(all.ProcessName)
        Next
you don't need to import System.Diagnostics namespaces
Didn't work, ugh.
Imports System.Diagnostics
Public Class Process
...
End Class
You're importing a "Process" class AND creating your own....it's not sure which Process class to look for the function in.
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?