Imports System.IO Public Class Form1 Dim File As New Process() Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged End Sub Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim P As New Process() Dim Count As Integer = 0 ListView1.Items.Clear() For Each P In Process.GetProcesses(My.Computer.Name) On Error Resume Next ListView1.Items.Add(P.ProcessName) ListView1.Items(Count).SubItems.Add(FormatNumber(Math.Round(P.PrivateMemorySize64 / 1024), 0)) ListView1.Items(Count).SubItems.Add(P.Responding) ListView1.Items(Count).SubItems.Add(P.StartTime.ToString.Trim) ListView1.Items(Count).SubItems.Add(P.Id) Count = Count + 1 Next End Sub Private Sub KillProcess() On Error GoTo Handled For Each P As ListViewItem In ListView1.SelectedItems System.Diagnostics.Process.GetProcessById(P.SubItems(4).Text).Kill() P.SubItems.Clear() Next Handled: MsgBox("Echech de fermer le processus") End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click KillProcess() End Sub Private Sub GetProcess() Dim P As New Process() Dim Count As Integer = 0 ListView1.Items.Clear() For Each P In Process.GetProcesses(My.Computer.Name) On Error Resume Next ListView1.Items.Add(P.ProcessName) ListView1.Items(Count).SubItems.Add(FormatNumber(Math.Round(P.PrivateMemorySize64 / 1024), 0)) ListView1.Items(Count).SubItems.Add(P.Responding) ListView1.Items(Count).SubItems.Add(P.StartTime.ToString.Trim) ListView1.Items(Count).SubItems.Add(P.Id) Count = Count + 1 Next End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click GetProcess() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) For Each P As ListViewItem In ListView1.SelectedItems System.Diagnostics.Process.GetProcessById(P.SubItems(4).Text) Directory.GetCurrentDirectory() Next End Sub End Sorry ................ Button3 don't work
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)