Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.16 KB | None | 0 0
  1. Public Class Form1
  2.  
  3.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  4.         Timer1.Enabled = True
  5.         Timer1.Interval = 10000
  6.         getList()
  7.         With ListView1
  8.             .View = View.Details
  9.             .Sorting = SortOrder.Ascending
  10.             .Columns.Add("Name", 50)
  11.             .Columns.Add("Dateipfad", 100)
  12.             .Columns.Add("ID", 50)
  13.         End With
  14.     End Sub
  15.  
  16.     Private Function getList()
  17.         ListView1.Clear()
  18.         Dim Item As ListViewItem
  19.         With ListView1
  20.             For Each rProcess As Process In Process.GetProcesses
  21.                 Item = .Items.Add(rProcess.ProcessName)
  22.                 Try
  23.                     Item.SubItems.Add(rProcess.MainModule.FileName)
  24.  
  25.                 Catch ex As Exception
  26.                     Item.SubItems.Add("Konnte Pfad nicht finden")
  27.                 End Try
  28.                 Item.SubItems.Add(rProcess.Id.ToString)
  29.             Next
  30.         End With
  31.     End Function
  32.  
  33.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  34.         getList()
  35.     End Sub
  36. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement