Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Timer1.Enabled = True
- Timer1.Interval = 10000
- getList()
- With ListView1
- .View = View.Details
- .Sorting = SortOrder.Ascending
- .Columns.Add("Name", 50)
- .Columns.Add("Dateipfad", 100)
- .Columns.Add("ID", 50)
- End With
- End Sub
- Private Function getList()
- ListView1.Clear()
- Dim Item As ListViewItem
- With ListView1
- For Each rProcess As Process In Process.GetProcesses
- Item = .Items.Add(rProcess.ProcessName)
- Try
- Item.SubItems.Add(rProcess.MainModule.FileName)
- Catch ex As Exception
- Item.SubItems.Add("Konnte Pfad nicht finden")
- End Try
- Item.SubItems.Add(rProcess.Id.ToString)
- Next
- End With
- End Function
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
- getList()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement