Imports System.ServiceProcess
Imports System.Diagnostics
Public Class Form1
Inherits System.Windows.Forms.Form
Dim Process As ServiceController
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents ServiceController1 As System.ServiceProcess.ServiceController
Friend WithEvents Button1 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.ListBox1 = New System.Windows.Forms.ListBox
Me.Label1 = New System.Windows.Forms.Label
Me.ServiceController1 = New System.ServiceProcess.ServiceController
Me.Button1 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'ListBox1
'
Me.ListBox1.ItemHeight = 16
Me.ListBox1.Location = New System.Drawing.Point(8, 24)
Me.ListBox1.Name = "ListBox1"
Me.ListBox1.Size = New System.Drawing.Size(128, 148)
Me.ListBox1.TabIndex = 0
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(8, 8)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(128, 16)
Me.Label1.TabIndex = 1
Me.Label1.Text = "Lista Processi:"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(8, 176)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(128, 24)
Me.Button1.TabIndex = 2
Me.Button1.Text = "Aggiorna"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(7, 15)
Me.ClientSize = New System.Drawing.Size(144, 206)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.ListBox1)
Me.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "Form1"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Process List"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For Each Process In ServiceController.GetServices
ListBox1.Items.Add(Process.ServiceName)
Next
End Sub
End Class