'****Modified by JWear on 4/12/2006****
Private Sub New()
If Debugger.IsAttached = True Then
' debug code: allows the process to run as a non-service
' will kick off the service start point, but never kill it.
' shut down the debugger to exit
'Open this page for help ' 'http://www.codeproject.com/dotnet/DebugWinServices.asp
Dim service As New YourService
Dim tempargs() As String
service.OnStart(tempargs)
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite)
Else
'Original Code Below
ServicesToRun = New System.ServiceProcess.ServiceBase() {New YourService}
System.ServiceProcess.ServiceBase.Run(ServicesToRun)
'Original Code Above
End If
'**************
End Sub
I left the page where I got it in the comments, a hat tip to the original site. The page is no longer available.
No comments:
Post a Comment