S
H
A
R
E

Monday, May 16, 2011

VBnet Get Process List


'This A ConsoleApplication
Imports System.Diagnostics
Module Module1
    Sub Main()
        Dim proc() As Process = Process.GetProcesses()
        For Each p As Process In proc
            Try
                Console.Write(p.MainModule.FileName)
                If p.MainWindowTitle.Length > 0 Then
                    Console.WriteLine(" - " & p.MainWindowTitle)
                End If
            Catch ex As Exception
            End Try
        Next p
        Console.ReadKey()
    End Sub
End Module


0 comments:

Post a Comment