Oracle
首先新建一個Windows Application工程
粘貼如下代碼文件
Form
Inherits System
<System
Public Sub New()
MyBase
InitializeComponent()
End Sub
<System
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components
End If
MyBase
End Sub
Private components As System
<System
Private Sub InitializeComponent()
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
Me
End Sub
Friend WithEvents Label
Friend WithEvents ListBox
Friend WithEvents Button
Friend WithEvents Button
End Class
Form
Imports System
Imports System
Public Class Form
Private procArray(
Private Sub Form
End Sub
Private Sub Form
procArray(
procArray(
procArray(
procArray(
procArray(
End Sub
Private Sub Button
Dim backThread As Thread
Dim i As Int
For i =
backThread = New Thread(AddressOf procClass
backThread
procClass
Label
Me
backThread
backThread
ListBox
Me
backThread = Nothing
Next
Label
End Sub
Private Sub Button
Dim backThread As Thread
Dim i As Int
For i =
backThread = New Thread(AddressOf procClass
procClass
Label
Me
backThread
backThread
ListBox
Me
backThread = Nothing
Next
Label
End Sub
Public Class procClass
Public Shared procName As String
Public Shared Sub StopProc()
Dim servController
If servController
ElseIf servController
servController
servController
ElseIf servController
servController
servController
End If
End Sub
Public Shared Sub StartProc()
Dim servController
If servController
ElseIf servController
servController
servController
ElseIf servController
servController
servController
End If
End Sub
End Class
End Class
總結
這個實例只是運用了系統服務控制的基本功能
改進
程序在運行時如果焦點離開
測試平台
Windows Server
From:http://tw.wingwit.com/Article/program/Oracle/201311/17456.html