EMailProfiler: Config-Daten in zentraler Klasse. abfrage der GDPicture Lizenz über Config-Modul

This commit is contained in:
2025-01-09 10:13:07 +01:00
parent 6193019051
commit ba999fa1d9
15 changed files with 178 additions and 103 deletions

View File

@@ -1,24 +1,23 @@
Imports System.ComponentModel
Imports System.IO
Imports System.Net.Mail
Imports System.IO
Imports System.Text.RegularExpressions
Imports DigitalData.Modules
Imports DigitalData.Modules.Config
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging
Imports GdPicture14
Imports Independentsoft.Email.Mime
Imports Attachment = Independentsoft.Email.Mime.Attachment
Imports LicenseManager = GdPicture14.LicenseManager
Public Class Form1
Private _logger As DigitalData.Modules.Logging.Logger
Private Shared MyLogger As LogConfig
Private _logger As Logger
Private Shared _MyLogger As LogConfig
Private _Worklist As List(Of String)
Private MyDatabase As MSSQLServer
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
Try
MyLogger = New LogConfig(LogConfig.PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log"), Nothing, My.Application.Info.CompanyName, My.Application.Info.ProductName)
_logger = MyLogger.GetLogger()
MyLogger.Debug = True
_MyLogger = New LogConfig(LogConfig.PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log"), Nothing, My.Application.Info.CompanyName, My.Application.Info.ProductName)
_logger = _MyLogger.GetLogger()
_MyLogger.Debug = True
Dim dbResult As Boolean
@@ -27,7 +26,7 @@ Public Class Form1
Exit Sub
End If
MyDatabase = New MSSQLServer(MyLogger, My.Settings.DD_ECM_CONSTRING)
MyDatabase = New MSSQLServer(_MyLogger, My.Settings.DD_ECM_CONSTRING)
If MyDatabase.DBInitialized = True Then
dbResult = True
@@ -112,7 +111,7 @@ Public Class Form1
If oCount = 1 Then
Continue For
End If
Dim oAttachmentFileString
Dim oAttachmentFileString As String = ""
oString = String.Format(" Working on Attachment [{0}]", oAttachment.GetFileName)
_logger.Info(oString)
ListBox1.Items.Add(oString)
@@ -206,8 +205,9 @@ Public Class Form1
End Sub
Private Sub ExtractEmbeddedPDFAttachments(pFilename As String)
Try
Dim oSQLGDPicture = "SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE ACTIVE = 1"
Dim GDPictureLicense As String = "21182889975216572111813147150675976632"
Dim GDPictureLicense As String = ConfigDbFunct.GetProductLicense("GDPICTURE", "11.2024", _MyLogger, My.Settings.DD_ECM_CONSTRING)
Dim oValidExtensions = New List(Of String) From {"pdf", "xls", "xlsx", "doc", "docx", "ppt", "pptx"}
Dim oGraphicExtensions = New List(Of String) From {"jpg", "bmp", "jpeg", "gif", "png", "xml"}
@@ -236,7 +236,7 @@ Public Class Form1
Dim oValidExt = oValidExtensions.Any(Function(ext) oEmbAttName.EndsWith(ext))
If oValidExt = False Then
_Logger.Info("Invalid FileExtension of embedded file [{0}]", oEmbAttName)
_logger.Info("Invalid FileExtension of embedded file [{0}]", oEmbAttName)
Dim GraphicExt = oGraphicExtensions.Any(Function(ext) oEmbAttName.EndsWith(ext))
If GraphicExt = False Then
Dim oInfo = $"Consistency or extension of attached file [{oEmbAttName}] is not ok."