MS Check Fodlerwatch
This commit is contained in:
parent
d7ffdb06c0
commit
28bf4f13cd
@ -122,7 +122,6 @@ Public Class ClassFilehandle
|
|||||||
filename = filename.Replace("'", "''")
|
filename = filename.Replace("'", "''")
|
||||||
|
|
||||||
Dim filename_only As String = Path.GetFileName(filename)
|
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 & "')"
|
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)
|
Return ClassDatabase.Execute_non_Query(ins, True)
|
||||||
|
|
||||||
|
|||||||
@ -487,10 +487,12 @@ Public Class frmStart
|
|||||||
tslblFW.Visible = False
|
tslblFW.Visible = False
|
||||||
End If
|
End If
|
||||||
If FWSCAN_started = True Then
|
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)
|
Dim fileEntries As String() = Directory.GetFiles(CURRENT_SCAN_FOLDERWATCH)
|
||||||
' Process the list of files found in the directory.
|
' Process the list of files found in the directory.
|
||||||
Dim fileName As String
|
Dim fileName As String
|
||||||
For Each fileName In fileEntries
|
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
|
For Each row As DataRow In DTEXCLUDE_FILES.Rows
|
||||||
Dim content As String = row.Item(0).ToString.ToLower
|
Dim content As String = row.Item(0).ToString.ToLower
|
||||||
If fileName.ToLower.Contains(content) Then
|
If fileName.ToLower.Contains(content) Then
|
||||||
@ -512,7 +514,39 @@ Public Class frmStart
|
|||||||
End If
|
End If
|
||||||
Next fileName
|
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
|
End If
|
||||||
If TimerFolderWatch.Enabled = False Then
|
If TimerFolderWatch.Enabled = False Then
|
||||||
TimerFolderWatch.Start()
|
TimerFolderWatch.Start()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user