Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Process List - Form1.vb

Form1.vb

Caricato da:
Scarica il programma completo

  1. Imports System.ServiceProcess
  2. Imports System.Diagnostics
  3. Public Class Form1
  4.     Inherits System.Windows.Forms.Form
  5.     Dim Process As ServiceController
  6. #Region " Windows Form Designer generated code "
  7.  
  8.     Public Sub New()
  9.         MyBase.New()
  10.  
  11.         'This call is required by the Windows Form Designer.
  12.         InitializeComponent()
  13.  
  14.         'Add any initialization after the InitializeComponent() call
  15.  
  16.     End Sub
  17.  
  18.     'Form overrides dispose to clean up the component list.
  19.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  20.         If disposing Then
  21.             If Not (components Is Nothing) Then
  22.                 components.Dispose()
  23.             End If
  24.         End If
  25.         MyBase.Dispose(disposing)
  26.     End Sub
  27.  
  28.     'Required by the Windows Form Designer
  29.     Private components As System.ComponentModel.IContainer
  30.  
  31.     'NOTE: The following procedure is required by the Windows Form Designer
  32.     'It can be modified using the Windows Form Designer.  
  33.     'Do not modify it using the code editor.
  34.     Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
  35.     Friend WithEvents Label1 As System.Windows.Forms.Label
  36.     Friend WithEvents ServiceController1 As System.ServiceProcess.ServiceController
  37.     Friend WithEvents Button1 As System.Windows.Forms.Button
  38.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  39.         Me.ListBox1 = New System.Windows.Forms.ListBox
  40.         Me.Label1 = New System.Windows.Forms.Label
  41.         Me.ServiceController1 = New System.ServiceProcess.ServiceController
  42.         Me.Button1 = New System.Windows.Forms.Button
  43.         Me.SuspendLayout()
  44.         '
  45.         'ListBox1
  46.         '
  47.         Me.ListBox1.ItemHeight = 16
  48.         Me.ListBox1.Location = New System.Drawing.Point(8, 24)
  49.         Me.ListBox1.Name = "ListBox1"
  50.         Me.ListBox1.Size = New System.Drawing.Size(128, 148)
  51.         Me.ListBox1.TabIndex = 0
  52.         '
  53.         'Label1
  54.         '
  55.         Me.Label1.Location = New System.Drawing.Point(8, 8)
  56.         Me.Label1.Name = "Label1"
  57.         Me.Label1.Size = New System.Drawing.Size(128, 16)
  58.         Me.Label1.TabIndex = 1
  59.         Me.Label1.Text = "Lista Processi:"
  60.         '
  61.         'Button1
  62.         '
  63.         Me.Button1.Location = New System.Drawing.Point(8, 176)
  64.         Me.Button1.Name = "Button1"
  65.         Me.Button1.Size = New System.Drawing.Size(128, 24)
  66.         Me.Button1.TabIndex = 2
  67.         Me.Button1.Text = "Aggiorna"
  68.         '
  69.         'Form1
  70.         '
  71.         Me.AutoScaleBaseSize = New System.Drawing.Size(7, 15)
  72.         Me.ClientSize = New System.Drawing.Size(144, 206)
  73.         Me.Controls.Add(Me.Button1)
  74.         Me.Controls.Add(Me.Label1)
  75.         Me.Controls.Add(Me.ListBox1)
  76.         Me.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  77.         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
  78.         Me.MaximizeBox = False
  79.         Me.MinimizeBox = False
  80.         Me.Name = "Form1"
  81.         Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
  82.         Me.Text = "Process List"
  83.         Me.ResumeLayout(False)
  84.  
  85.     End Sub
  86.  
  87. #End Region
  88.  
  89.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  90.         For Each Process In ServiceController.GetServices
  91.             ListBox1.Items.Add(Process.ServiceName)
  92.         Next
  93.     End Sub
  94. End Class