diff --git a/Global_Indexer/ClassFilehandle.vb b/Global_Indexer/ClassFilehandle.vb index 3ccf7e4..c46bcfe 100644 --- a/Global_Indexer/ClassFilehandle.vb +++ b/Global_Indexer/ClassFilehandle.vb @@ -122,7 +122,6 @@ Public Class ClassFilehandle filename = filename.Replace("'", "''") Dim filename_only As String = Path.GetFileName(filename) - Dim ins As String = "INSERT INTO TBGI_FILES_USER (FILENAME2WORK, USER@WORK,HANDLE_TYPE,FILENAME_ONLY) VALUES ('" & filename & "','" & Environment.UserName & "','" & handleType & "','" & filename_only & "')" Return ClassDatabase.Execute_non_Query(ins, True) diff --git a/Global_Indexer/frmStart.vb b/Global_Indexer/frmStart.vb index 2a0ba63..dddfe6a 100644 --- a/Global_Indexer/frmStart.vb +++ b/Global_Indexer/frmStart.vb @@ -487,10 +487,12 @@ Public Class frmStart tslblFW.Visible = False End If If FWSCAN_started = True Then + If LogErrorsOnly = False Then ClassLogger.Add(">> FWSCAN started - Checking file:" & CURRENT_SCAN_FOLDERWATCH, False) Dim fileEntries As String() = Directory.GetFiles(CURRENT_SCAN_FOLDERWATCH) ' Process the list of files found in the directory. Dim fileName As String For Each fileName In fileEntries + If LogErrorsOnly = False Then ClassLogger.Add(">> Scanfolder after startup: Checking file:" & fileName, False) For Each row As DataRow In DTEXCLUDE_FILES.Rows Dim content As String = row.Item(0).ToString.ToLower If fileName.ToLower.Contains(content) Then @@ -512,7 +514,39 @@ Public Class frmStart End If Next fileName + Else + If LogErrorsOnly = False Then ClassLogger.Add(">> FWSCAN not started", False) + End If + If FW_started = True Then + If LogErrorsOnly = False Then ClassLogger.Add(">> FW_started started - Checking file:" & CURRENT_FOLDERWATCH, False) + Dim fileEntries As String() = Directory.GetFiles(CURRENT_FOLDERWATCH) + ' Process the list of files found in the directory. + Dim fileName As String + For Each fileName In fileEntries + If LogErrorsOnly = False Then ClassLogger.Add(">> Folderwach after startup: Checking file:" & fileName, False) + For Each row As DataRow In DTEXCLUDE_FILES.Rows + Dim content As String = row.Item(0).ToString.ToLower + If fileName.ToLower.Contains(content) Then + Exit Sub + End If + Next + Dim handleType As String + If fileName.ToLower.EndsWith(".msg") Then + handleType = "|FW_OUTLOOK_MESSAGE|" + Else + handleType = "|FW_SIMPLEINDEXER|" + End If + 'Die Datei übergeben + If LogErrorsOnly = False Then ClassLogger.Add(">> Adding file from Folderwatch after startup:" & fileName, False) + If ClassIndexFunctions.FileExistsinDropTable(fileName) = False Then + ClassFilehandle.Decide_FileHandle(fileName, handleType) + Else + ClassLogger.Add(">> Folderwatch Startup: File already exists:" & fileName, False) + End If + Next fileName + Else + If LogErrorsOnly = False Then ClassLogger.Add(">> FW_started not started", False) End If If TimerFolderWatch.Enabled = False Then TimerFolderWatch.Start()