MS Release CleanFileName

This commit is contained in:
2021-12-01 12:12:04 +01:00
parent ae5bc40f5f
commit 0f94cab4f1
88 changed files with 329 additions and 9548 deletions

View File

@@ -289,13 +289,13 @@ Public Class frmMain
MyLogger.Debug = True
Dim _work As New clsWorker(MyLogger, _SQLServerConString, GUIDTextBox.Text, My.Settings.FB_DATASOURCE, My.Settings.FB_DATABASE, My.Settings.FB_USER, My.Settings.FB_PW,
My.Settings.USE_WM, ToolStripEmailAccountID.Text)
My.Settings.USE_WM, ToolStripEmailAccountID.Text, "EmailProfilerTestClient")
_work.Start_WorkingProfiles()
Else
For Each ofile As String In _Worklist
Logger.Info($"## Manual working on file {ofile} ... ")
Dim _work As New clsWorker(MyLogger, _SQLServerConString, GUIDTextBox.Text, My.Settings.FB_DATASOURCE, My.Settings.FB_DATABASE, My.Settings.FB_USER, My.Settings.FB_PW, My.Settings.USE_WM, ofile)
Dim _work As New clsWorker(MyLogger, _SQLServerConString, GUIDTextBox.Text, My.Settings.FB_DATASOURCE, My.Settings.FB_DATABASE, My.Settings.FB_USER, My.Settings.FB_PW, My.Settings.USE_WM, ToolStripEmailAccountID.Text, "EmailProfilerTestClient", ofile)
_work.Start_WorkingProfiles(True)
Next
@@ -678,17 +678,17 @@ Public Class frmMain
_database.Execute_non_Query(upd)
Load_Config()
End Sub
Private Function GetChildren(ByVal bodyParts As BodyPartCollection) As BodyPartCollection
'Private Function GetChildren(ByVal bodyParts As BodyPartCollection) As BodyPartCollection
Dim children As New BodyPartCollection()
' Dim children As New BodyPartCollection()
For i As Integer = 0 To bodyParts.Count - 1
children.Add(GetChildren(bodyParts(i).BodyParts))
children.Add(bodyParts(i))
Next
' For i As Integer = 0 To bodyParts.Count - 1
' children.Add(GetChildren(bodyParts(i).BodyParts))
' children.Add(bodyParts(i))
' Next
Return children
End Function
' Return children
'End Function
Private Sub STEP_NAMEComboBox_SelectedIndexChanged(sender As Object, e As EventArgs) Handles STEP_NAMEComboBox.SelectedIndexChanged
Label9.Visible = False
@@ -744,24 +744,35 @@ Public Class frmMain
Dim oSQL = $"SELECT * FROM TBDD_EMAIL_ACCOUNT WHERE GUID = {EMAILIDTextBox.Text}"
Dim oDT As DataTable = _database.Return_Datatable(oSQL)
If Not IsNothing(oDT) Then
If oDT.Rows.Count = 1 Then
Dim PWPlain = _Encryption.DecryptData(oDT.Rows(0).Item("EMAIL_PW"))
'Logger.Debug($"PWis !{PWPlain}35452dd=")
_limilab.InitIMAP(oDT.Rows(0).Item("EMAIL_SMTP"), oDT.Rows(0).Item("PORT_IN"), oDT.Rows(0).Item("EMAIL_USER"), PWPlain, oDT.Rows(0).Item("AUTH_TYPE"))
_limilab.InitIMAP(True, oDT.Rows(0).Item("EMAIL_SMTP"), oDT.Rows(0).Item("PORT_IN"), oDT.Rows(0).Item("EMAIL_USER"), PWPlain, oDT.Rows(0).Item("AUTH_TYPE"))
Dim oResult = _limilab.IMAPTestLogin()
If oResult = False Then
MsgBox("Access Imap NOT successfull", MsgBoxStyle.Critical)
Else
MsgBox("Test Successful!", MsgBoxStyle.Information)
MsgBox("IMAP-Test Successful!", MsgBoxStyle.Information)
btnCheckIMAPObjects.Visible = True
End If
End If
End If
End Sub
Private Sub btnCheckIMAPObjects_Click(sender As Object, e As EventArgs) Handles btnCheckIMAPObjects.Click
Dim oListuids As New List(Of Long)
oListuids = _limilab.IMAPGetUnseenMessageIDs()
If IsNothing(oListuids) Then
MsgBox("Something went wrong! - Check Your log.", MsgBoxStyle.Critical)
Else
_limilab.CloseImap()
MsgBox($"IMAP-Folder contained [{oListuids.Count}] unseen Objects!", MsgBoxStyle.Information)
End If
End Sub
Private Sub btnTestRegEx_Click(sender As Object, e As EventArgs) Handles btnTestRegEx.Click
txtResultRegEx.Text = ""
Try
@@ -815,56 +826,56 @@ Public Class frmMain
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Try
txthtmlEmail.Text = ""
txthtmlEmail.BackColor = Color.Wheat
Dim oOpenFileDialog1 As New OpenFileDialog()
'Try
' txthtmlEmail.Text = ""
' txthtmlEmail.BackColor = Color.Wheat
' Dim oOpenFileDialog1 As New OpenFileDialog()
' openFileDialog1.InitialDirectory = "c:\"
oOpenFileDialog1.Filter = "Emails (*.eml)|*.eml|All files (*.*)|*.*"
oOpenFileDialog1.FilterIndex = 2
oOpenFileDialog1.RestoreDirectory = True
' ' openFileDialog1.InitialDirectory = "c:\"
' oOpenFileDialog1.Filter = "Emails (*.eml)|*.eml|All files (*.*)|*.*"
' oOpenFileDialog1.FilterIndex = 2
' oOpenFileDialog1.RestoreDirectory = True
If oOpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
Dim oMsg_email As New Independentsoft.Email.Mime.Message(oOpenFileDialog1.FileName)
Dim oBodyText As String = ""
If IsNothing(oMsg_email.Body) Then
Dim oAllBodyParts As New BodyPartCollection()
oAllBodyParts.Add(oMsg_email.BodyParts)
oAllBodyParts.Add(GetChildren(oMsg_email.BodyParts))
For Each bodyPart As BodyPart In oAllBodyParts
If bodyPart.ContentType IsNot Nothing AndAlso bodyPart.ContentType.Type = "text" AndAlso bodyPart.ContentType.SubType = "plain" Then
If oBodyText = String.Empty Then
Logger.Debug(String.Format("BODY1-Text is....#{0}", bodyPart.Body))
oBodyText = bodyPart.Body
Else
Continue For
End If
ElseIf bodyPart.ContentType IsNot Nothing AndAlso bodyPart.ContentType.Type = "text" AndAlso bodyPart.ContentType.SubType = "html" Then
If oBodyText = String.Empty Then
oBodyText = bodyPart.Body
Logger.Debug(String.Format("bodyhtml....#{0}", bodyPart.Body))
Else
Continue For
End If
Logger.Debug(String.Format("bodyhtml....#{0}", bodyPart.Body))
End If
Next
If oBodyText = "" Then
MsgBox("No html-body extractable?!")
Else
txthtmlEmail.Text = oBodyText
txthtmlEmail.BackColor = Color.Yellow
End If
Else
txthtmlEmail.Text = oMsg_email.Body
txthtmlEmail.BackColor = Color.Yellow
End If
' If oOpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
' Dim oMsg_email As New Independentsoft.Email.Mime.Message(oOpenFileDialog1.FileName)
' Dim oBodyText As String = ""
' If IsNothing(oMsg_email.Body) Then
' Dim oAllBodyParts As New BodyPartCollection()
' oAllBodyParts.Add(oMsg_email.BodyParts)
' oAllBodyParts.Add(GetChildren(oMsg_email.BodyParts))
' For Each bodyPart As BodyPart In oAllBodyParts
' If bodyPart.ContentType IsNot Nothing AndAlso bodyPart.ContentType.Type = "text" AndAlso bodyPart.ContentType.SubType = "plain" Then
' If oBodyText = String.Empty Then
' Logger.Debug(String.Format("BODY1-Text is....#{0}", bodyPart.Body))
' oBodyText = bodyPart.Body
' Else
' Continue For
' End If
' ElseIf bodyPart.ContentType IsNot Nothing AndAlso bodyPart.ContentType.Type = "text" AndAlso bodyPart.ContentType.SubType = "html" Then
' If oBodyText = String.Empty Then
' oBodyText = bodyPart.Body
' Logger.Debug(String.Format("bodyhtml....#{0}", bodyPart.Body))
' Else
' Continue For
' End If
' Logger.Debug(String.Format("bodyhtml....#{0}", bodyPart.Body))
' End If
' Next
' If oBodyText = "" Then
' MsgBox("No html-body extractable?!")
' Else
' txthtmlEmail.Text = oBodyText
' txthtmlEmail.BackColor = Color.Yellow
' End If
' Else
' txthtmlEmail.Text = oMsg_email.Body
' txthtmlEmail.BackColor = Color.Yellow
' End If
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical)
End Try
' End If
'Catch ex As Exception
' MsgBox(ex.Message, MsgBoxStyle.Critical)
'End Try
End Sub
@@ -897,8 +908,13 @@ Public Class frmMain
Private Sub COMMENTTextBox_Leave(sender As Object, e As EventArgs) Handles COMMENTTextBox.Leave
Dim separatorIndex = COMMENTTextBox.Text.IndexOf(".")
TextBox1.Text = COMMENTTextBox.Text.Substring(separatorIndex, COMMENTTextBox.Text.Length - 1)
Try
Dim separatorIndex = COMMENTTextBox.Text.IndexOf(".")
TextBox1.Text = COMMENTTextBox.Text.Substring(separatorIndex, COMMENTTextBox.Text.Length - 1)
Catch ex As Exception
End Try
End Sub
Private Sub EMAILIDTextBox_TextChanged(sender As Object, e As EventArgs) Handles EMAILIDTextBox.TextChanged
@@ -907,7 +923,7 @@ Public Class frmMain
Else
ToolStripEmailAccountID.Text = "Choose Email-Config"
End If
btnCheckIMAPObjects.Visible = False
End Sub
Private Sub AUTH_TYPEComboBox_SelectedIndexChanged(sender As Object, e As EventArgs) Handles AUTH_TYPEComboBox.SelectedIndexChanged
@@ -920,4 +936,15 @@ Public Class frmMain
End Select
End If
End Sub
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
Try
If ComboBox1.SelectedIndex <> -1 Then
ToolStripEmailAccountID.Text = ComboBox1.SelectedValue
End If
Catch ex As Exception
End Try
End Sub
End Class