EMail Profiler: Test-Projekt kann jetzt EML-Dateien einlesen. / Der erste E-Mail-Anhang darf eine XML-Datei sein
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
Imports System.IO
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports DevExpress.Data.Helpers.ExpressiveSortInfo
|
||||
Imports DigitalData.Modules.Config
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EmailProfiler.Common
|
||||
Imports GdPicture14
|
||||
Imports Independentsoft.Email.Mime
|
||||
Imports Attachment = Independentsoft.Email.Mime.Attachment
|
||||
@@ -13,6 +15,7 @@ Public Class Form1
|
||||
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)
|
||||
@@ -64,7 +67,8 @@ Public Class Form1
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
|
||||
Private Sub btRunEmailCheck_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btRunEmailCheck.ItemClick
|
||||
' Check Email
|
||||
ListBox1.Items.Clear()
|
||||
Dim di As New DirectoryInfo(bsifolderbrowser.Caption)
|
||||
' Get a reference to each file in that directory.
|
||||
@@ -132,7 +136,7 @@ Public Class Form1
|
||||
oString = " ## Attachment NOT EXISTING ##"
|
||||
_logger.Info(oString)
|
||||
ListBox1.Items.Add(oString)
|
||||
If System.IO.File.Exists(oAttachmentFileString) = False Then
|
||||
If File.Exists(oAttachmentFileString) = False Then
|
||||
_logger.Debug(String.Format("Trying to save attachment [{0}]", oAttachmentFileString))
|
||||
Try
|
||||
oAttachment.Save(oAttachmentFileString)
|
||||
@@ -190,7 +194,7 @@ Public Class Form1
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Sub BarButtonItem4_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem4.ItemClick
|
||||
Private Sub btExtractPdfAttachments_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem4.ItemClick
|
||||
' FileOpen Dialog
|
||||
Dim fileOpenDlg = OpenFileDialog1
|
||||
|
||||
@@ -268,4 +272,33 @@ Public Class Form1
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub btExtractMailAttachments_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btExtractMailAttachments.ItemClick
|
||||
' Hier verarbeiten wir eine ausgewählte EML-Datei
|
||||
' und speichern alle Anhänge auf die Platte.
|
||||
' Der Einstieg und der Ablauf entspricht dem des Services.
|
||||
' Unterschied ist die lokale Datei
|
||||
|
||||
Dim connectionString As String = "Server=SDD-VMP04-SQL17\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=dd"
|
||||
|
||||
Dim oConfigData As ConfigData = New ConfigData() With {
|
||||
.Debug = False,
|
||||
.GDPictureVersion = "11.2024",
|
||||
.UseWindream = False,
|
||||
.ConnectionString = connectionString
|
||||
}
|
||||
|
||||
Dim Worker As ExtractAttachmentsFromEMLFile = New ExtractAttachmentsFromEMLFile()
|
||||
|
||||
' FileOpen Dialog
|
||||
Dim fileOpenDlg = OpenFileDialog2
|
||||
|
||||
If fileOpenDlg.ShowDialog() = DialogResult.OK Then
|
||||
Dim oFilename = fileOpenDlg.FileName
|
||||
|
||||
' Call Extract Method
|
||||
Worker.CallWorkerProcess(oFilename, oConfigData)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user