Check dropped files by hash instead of filename #GI-12
This commit is contained in:
@@ -550,7 +550,7 @@ Public Class frmIndex
|
||||
Dim oMatchelements As System.Text.RegularExpressions.MatchCollection = regulärerAusdruck.Matches(oNamenkonvention)
|
||||
'####
|
||||
If oMatchelements.Count = 0 Then
|
||||
_Logger.Debug("No RegularExpression Fileds on Nameconvention!")
|
||||
_Logger.Debug("No RegularExpression Files on Nameconvention!")
|
||||
End If
|
||||
' alle Vorkommen innerhalbd er Namenkonvention durchlaufen
|
||||
For Each oElement As System.Text.RegularExpressions.Match In oMatchelements
|
||||
@@ -1301,7 +1301,9 @@ Public Class frmIndex
|
||||
Try
|
||||
Dim tempCur_WF = CURRENT_WORKFILE.Replace("'", "''")
|
||||
Dim tempCur_New_FN = CURRENT_NEWFILENAME.Replace("'", "''")
|
||||
Insert_String = sql_history_INSERT_INTO & ",ADDED_WHO,ADDED_WHERE) VALUES ('" & tempCur_WF & "','" & tempCur_New_FN & "'" & sql_history_Index_Values & ",'" & Environment.UserDomainName & "\" & Environment.UserName & "','" & Environment.MachineName & "')"
|
||||
Dim oUser As String = $"{Environment.UserDomainName}\{Environment.UserName}"
|
||||
|
||||
Insert_String = sql_history_INSERT_INTO & $",ADDED_WHO, ADDED_WHERE, FILE_HASH) VALUES ('{tempCur_WF}','{tempCur_New_FN}'{sql_history_Index_Values},'{oUser}','{Environment.MachineName}','{CURRENT_WORKFILE_HASH}')"
|
||||
If ClassDatabase.Execute_non_Query(Insert_String) = True Then
|
||||
If CURRENT_MESSAGEID <> "" Then
|
||||
Dim max As String = "SELECT MAX(GUID) FROM TBGI_HISTORY"
|
||||
@@ -2230,66 +2232,67 @@ Public Class frmIndex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Sub OK_Button_Click(sender As Object, e As EventArgs)
|
||||
ClearError()
|
||||
ClearNotice()
|
||||
'Private Sub OK_Button_Click(sender As Object, e As EventArgs)
|
||||
' ClearError()
|
||||
' ClearNotice()
|
||||
|
||||
'lblhinweis.Visible = False
|
||||
'lblerror.Visible = False
|
||||
' 'lblhinweis.Visible = False
|
||||
' 'lblerror.Visible = False
|
||||
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
ClassHelper.Refresh_RegexTable()
|
||||
For Each rowregex As DataRow In CURRENT_DT_REGEX.Rows
|
||||
If rowregex.Item("FUNCTION_NAME") = "CLEAN_FILENAME" Then
|
||||
REGEX_CLEAN_FILENAME = rowregex.Item("REGEX")
|
||||
End If
|
||||
Next
|
||||
If checkMultiindex.Visible = True And checkMultiindex.Checked = True Then
|
||||
'Die erste Datei indexieren
|
||||
If WORK_FILE() = True Then
|
||||
'Und nun die folgenden
|
||||
Dim DTFiles2Work As DataTable = ClassDatabase.Return_Datatable("SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND GUID <> " & CURRENT_WORKFILE_GUID & " AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')")
|
||||
If Not DTFiles2Work Is Nothing Then
|
||||
Dim err = False
|
||||
For Each filerow As DataRow In DTFiles2Work.Rows
|
||||
CURRENT_WORKFILE_GUID = filerow.Item("GUID")
|
||||
CURRENT_WORKFILE = filerow.Item("FILENAME2WORK")
|
||||
DropType = filerow.Item("HANDLE_TYPE")
|
||||
' Me.Cursor = Cursors.WaitCursor
|
||||
' ClassHelper.Refresh_RegexTable()
|
||||
' For Each rowregex As DataRow In CURRENT_DT_REGEX.Rows
|
||||
' If rowregex.Item("FUNCTION_NAME") = "CLEAN_FILENAME" Then
|
||||
' REGEX_CLEAN_FILENAME = rowregex.Item("REGEX")
|
||||
' End If
|
||||
' Next
|
||||
' If checkMultiindex.Visible = True And checkMultiindex.Checked = True Then
|
||||
' 'Die erste Datei indexieren
|
||||
' If WORK_FILE() = True Then
|
||||
' 'Und nun die folgenden
|
||||
' Dim DTFiles2Work As DataTable = ClassDatabase.Return_Datatable("SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND GUID <> " & CURRENT_WORKFILE_GUID & " AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')")
|
||||
' If Not DTFiles2Work Is Nothing Then
|
||||
' Dim err = False
|
||||
' For Each filerow As DataRow In DTFiles2Work.Rows
|
||||
' CURRENT_WORKFILE_GUID = filerow.Item("GUID")
|
||||
' CURRENT_WORKFILE_HASH = NotNull(filerow.Item("FILE_HASH"), "")
|
||||
' CURRENT_WORKFILE = filerow.Item("FILENAME2WORK")
|
||||
' DropType = filerow.Item("HANDLE_TYPE")
|
||||
|
||||
If WORK_FILE() = False Then
|
||||
err = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Me.Cursor = Cursors.Default
|
||||
If err = False Then
|
||||
If USER_LANGUAGE = LANG_DE Then
|
||||
MsgBox("Alle Dateien wurden mit Multiindexing erfolgreich verarbeitet!", MsgBoxStyle.Information, "Erfolgsmeldung:")
|
||||
Else
|
||||
MsgBox("All files were successfully processed through Multiindexing", MsgBoxStyle.Information, "Success")
|
||||
End If
|
||||
' If WORK_FILE() = False Then
|
||||
' err = True
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
' Me.Cursor = Cursors.Default
|
||||
' If err = False Then
|
||||
' If USER_LANGUAGE = LANG_DE Then
|
||||
' MsgBox("Alle Dateien wurden mit Multiindexing erfolgreich verarbeitet!", MsgBoxStyle.Information, "Erfolgsmeldung:")
|
||||
' Else
|
||||
' MsgBox("All files were successfully processed through Multiindexing", MsgBoxStyle.Information, "Success")
|
||||
' End If
|
||||
|
||||
Me.Close()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If WORK_FILE() = True Then
|
||||
Me.Cursor = Cursors.Default
|
||||
' Me.Close()
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' Else
|
||||
' If WORK_FILE() = True Then
|
||||
' Me.Cursor = Cursors.Default
|
||||
|
||||
If CONFIG.Config.ShowIndexResult = True Then
|
||||
If USER_LANGUAGE = LANG_DE Then
|
||||
MsgBox("Die Datei wurde erfolgreich verarbeitet!" & vbNewLine & "Ablagepfad:" & vbNewLine & CURRENT_NEWFILENAME, MsgBoxStyle.Information, "Erfolgsmeldung")
|
||||
Else
|
||||
MsgBox("File sucessfully processed!" & vbNewLine & "Path:" & vbNewLine & CURRENT_NEWFILENAME, MsgBoxStyle.Information, "Success")
|
||||
End If
|
||||
End If
|
||||
' If CONFIG.Config.ShowIndexResult = True Then
|
||||
' If USER_LANGUAGE = LANG_DE Then
|
||||
' MsgBox("Die Datei wurde erfolgreich verarbeitet!" & vbNewLine & "Ablagepfad:" & vbNewLine & CURRENT_NEWFILENAME, MsgBoxStyle.Information, "Erfolgsmeldung")
|
||||
' Else
|
||||
' MsgBox("File sucessfully processed!" & vbNewLine & "Path:" & vbNewLine & CURRENT_NEWFILENAME, MsgBoxStyle.Information, "Success")
|
||||
' End If
|
||||
' End If
|
||||
|
||||
Me.Close()
|
||||
End If
|
||||
End If
|
||||
Me.Cursor = Cursors.Default
|
||||
End Sub
|
||||
' Me.Close()
|
||||
' End If
|
||||
' End If
|
||||
' Me.Cursor = Cursors.Default
|
||||
'End Sub
|
||||
Private Function Move_File2_Target()
|
||||
Dim oError As Boolean
|
||||
Try
|
||||
@@ -2321,7 +2324,9 @@ Public Class frmIndex
|
||||
Try
|
||||
Dim tempCur_WF = CURRENT_WORKFILE.Replace("'", "''")
|
||||
Dim tempCur_New_FN = CURRENT_NEWFILENAME.Replace("'", "''")
|
||||
Insert_String = sql_history_INSERT_INTO & ",ADDED_WHO) VALUES ('" & tempCur_WF & "','" & tempCur_New_FN & "'" & sql_history_Index_Values & ",'" & Environment.UserDomainName & "\" & Environment.UserName & "')"
|
||||
Dim oUser As String = $"{Environment.UserDomainName}\{Environment.UserName}"
|
||||
|
||||
Insert_String = sql_history_INSERT_INTO & $",ADDED_WHO, ADDED_WHERE, FILE_HASH) VALUES ('{tempCur_WF}','{tempCur_New_FN}'{sql_history_Index_Values},'{oUser}','{Environment.MachineName}','{CURRENT_WORKFILE_HASH}')"
|
||||
ClassDatabase.Execute_Scalar(Insert_String, MyConnectionString, True)
|
||||
If DropType.Contains("MSG") Or DropType = "|ATTMNTEXTRACTED|" Or DropType = "|OUTLOOK_ATTACHMENT|" Then
|
||||
If CURRENT_MESSAGEID <> "" Then
|
||||
@@ -2641,6 +2646,7 @@ Public Class frmIndex
|
||||
For Each filerow As DataRow In DTFiles2Work.Rows
|
||||
CURRENT_WORKFILE_GUID = filerow.Item("GUID")
|
||||
CURRENT_WORKFILE = filerow.Item("FILENAME2WORK")
|
||||
CURRENT_WORKFILE_HASH = NotNull(filerow.Item("FILE_HASH"), "")
|
||||
DropType = filerow.Item("HANDLE_TYPE")
|
||||
|
||||
If WORK_FILE() = False Then
|
||||
|
||||
Reference in New Issue
Block a user