MS SQL Overview Connection enable

This commit is contained in:
2020-12-14 15:39:22 +01:00
parent 4d2ee99a82
commit 8b1d519992
13 changed files with 527 additions and 452 deletions

View File

@@ -4,9 +4,9 @@ Imports DLLLicenseManager
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Config
Imports System.Threading
Imports DigitalData.Modules.EDMI.API
Public Class ClassInit
Public _lizenzManager As ClassLicenseManager
Public Sub New()
@@ -22,6 +22,21 @@ Public Class ClassInit
LOGGER = LOGCONFIG.GetLogger("ProcessManager")
LOGGER.Info("## ProcessManager started - {0}", Now)
Try
Dim directory As New IO.DirectoryInfo(Application.LocalUserAppDataPath & "\Log")
For Each file As IO.FileInfo In directory.GetFiles
If (Now - file.CreationTime).Days > 29 Then
file.Delete()
Else
Exit For
End If
Next
Catch ex As Exception
End Try
End Sub
<STAThread()>
@@ -54,6 +69,23 @@ Public Class ClassInit
CONNECTION_STRING_READ = CONNECTION_STRING
End If
If CONFIG.Config.AppServerConfig <> String.Empty Then
Try
_Client = New Client(LOGCONFIG, CONFIG.Config.AppServerConfig, 9000)
If Not IsNothing(_Client) Then
If _Client.Connect() Then
APPSERVER_ACTIVE = True
End If
End If
Catch ex As Exception
LOGGER.Warn($"Could not initialize the AppServer: {ex.Message}")
End Try
End If
'VIEWER_UNIVERSAL = CONFIG.Config.UniversalViewerPath
'VIEWER_XCHANGE = CONFIG.Config.XChangeViewerPath
'VIEWER_SUMATRA = CONFIG.Config.SumatraViewerPath
@@ -120,7 +152,9 @@ Public Class ClassInit
End If
End If
If dbResult = False Then
If dbResult = False Then
ERROR_STATE = "FAILED DBCONNECTION"
MsgBox("Error in init database. (Connection failed) More information in the logfile.", MsgBoxStyle.Critical)
Return False