36 lines
1.1 KiB
VB.net
36 lines
1.1 KiB
VB.net
Imports System.IO
|
|
Imports DigitalData.Modules.Database
|
|
Imports DigitalData.Modules.Logging
|
|
|
|
Public Class ZUGFeRDService
|
|
Private _logConfig As LogConfig
|
|
Private _logger As Logger
|
|
Private _firebird As Firebird
|
|
|
|
Private _threadRunner As ThreadRunner
|
|
|
|
Protected Overrides Sub OnStart(ByVal args() As String)
|
|
_logConfig = New LogConfig(LogConfig.PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log"))
|
|
_logger = _logConfig.GetLogger()
|
|
_logger.Info($"{My.Settings.SERVICE_NAME} is starting.")
|
|
|
|
Dim oDataSource As String = ""
|
|
Dim oDatabase As String = ""
|
|
Dim oUser As String = ""
|
|
Dim oPassword As String = ""
|
|
Dim watchDirectories As New List(Of String) From {"E:\ZUGFeRD_Import"}
|
|
|
|
_firebird = New Firebird(_logConfig, oDataSource, oDatabase, oUser, oPassword)
|
|
|
|
_threadRunner = New ThreadRunner(_logConfig, watchDirectories)
|
|
_threadRunner.Start()
|
|
End Sub
|
|
|
|
Protected Overrides Sub OnStop()
|
|
_logger.Info($"{My.Settings.SERVICE_NAME} is stopping.")
|
|
|
|
_threadRunner.Stop()
|
|
End Sub
|
|
|
|
End Class
|