MS Check Fodlerwatch

This commit is contained in:
Digital Data - Marlon Schreiber 2018-01-24 12:10:28 +01:00
parent d7ffdb06c0
commit 28bf4f13cd
2 changed files with 34 additions and 1 deletions

View File

@ -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)

View File

@ -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()