Selamın aleyküm beyler ben kodlama işlerinde biraz yeniyimde
Vb.NET ten görev yöneticisi yapmaya çalışıyorum herşey tam fakat önizlediğimde programlar ekrana
gelmiyor sizce bunun sebebi ne olabilir buyrun bunlarda kodlar
Imports System
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Text = "Computer Name : " & Environment.MachineName
ListView1.View = View.Details
ListView1.GridLines = True
ListView1.Dock = DockStyle.Fill
Me.Height = 400
Me.Width = 300
ToolStrip1.Dock = DockStyle.Top
ToolStrip2.Dock = DockStyle.Bottom
Dim durum As String
Dim durumson As String
Dim i As Integer = 0
Dim Process As New Process()
ListView1.Items.Clear()
For Each p In Process.GetProcesses(My.Computer.Name)
ListView1.Items.Add(p.ProcessName)
ListView1.Items(i).SubItems.Add(p.Id)
ListView1.Items(i).SubItems.Add(FormatNumber(Math.Round(p.PrivateMemorySize64 / 1024), 0) + "KB")
durum = p.Responding
durumson = Replace(durum, "True", "Çalışıyor")
ListView1.Items(i).SubItems.Add(durumson)
i += 1
Next
ToolStrip1.Text = "Çalışan : " & ListView1.Items.Count
ToolStrip2.Text = "işlemci Sayısı : " & Environment.ProcessorCount
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
Try
For Each Process As ListViewItem In ListView1.SelectedItems
System.Diagnostics.Process.GetProcessById(Process.SubItems(1).Text).Kill()
Next
MsgBox("Kapatıldı")
Catch ex As Exception
MsgBox("Hata : " + ErrorToString())
End Try
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Form1_Load(Nothing, Nothing)
End Sub
Private Sub ToolStripButton1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
End Sub
End Class
Şimdiden çok teşekkür ederim arkadaşlar
Vb.NET ten görev yöneticisi yapmaya çalışıyorum herşey tam fakat önizlediğimde programlar ekrana
gelmiyor sizce bunun sebebi ne olabilir buyrun bunlarda kodlar
Imports System
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Text = "Computer Name : " & Environment.MachineName
ListView1.View = View.Details
ListView1.GridLines = True
ListView1.Dock = DockStyle.Fill
Me.Height = 400
Me.Width = 300
ToolStrip1.Dock = DockStyle.Top
ToolStrip2.Dock = DockStyle.Bottom
Dim durum As String
Dim durumson As String
Dim i As Integer = 0
Dim Process As New Process()
ListView1.Items.Clear()
For Each p In Process.GetProcesses(My.Computer.Name)
ListView1.Items.Add(p.ProcessName)
ListView1.Items(i).SubItems.Add(p.Id)
ListView1.Items(i).SubItems.Add(FormatNumber(Math.Round(p.PrivateMemorySize64 / 1024), 0) + "KB")
durum = p.Responding
durumson = Replace(durum, "True", "Çalışıyor")
ListView1.Items(i).SubItems.Add(durumson)
i += 1
Next
ToolStrip1.Text = "Çalışan : " & ListView1.Items.Count
ToolStrip2.Text = "işlemci Sayısı : " & Environment.ProcessorCount
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
Try
For Each Process As ListViewItem In ListView1.SelectedItems
System.Diagnostics.Process.GetProcessById(Process.SubItems(1).Text).Kill()
Next
MsgBox("Kapatıldı")
Catch ex As Exception
MsgBox("Hata : " + ErrorToString())
End Try
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Form1_Load(Nothing, Nothing)
End Sub
Private Sub ToolStripButton1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
End Sub
End Class
Şimdiden çok teşekkür ederim arkadaşlar
