|
|
|
|
@ -10,6 +10,7 @@ Imports System
|
|
|
|
|
Imports System.SystemException
|
|
|
|
|
Imports System.Web.Mail
|
|
|
|
|
Imports System.Timers
|
|
|
|
|
Imports System.Collections.Generic
|
|
|
|
|
|
|
|
|
|
'''<summary></summary>
|
|
|
|
|
Public Class Service1
|
|
|
|
|
@ -161,9 +162,10 @@ Public Class Service1
|
|
|
|
|
Else
|
|
|
|
|
GSF_Timer.Interval = Params.Prop_gsf_TimerInterval
|
|
|
|
|
#If CONFIG = "Release" Then
|
|
|
|
|
GSF_Timer.Enabled = True
|
|
|
|
|
|
|
|
|
|
GSF_Timer.Enabled = GSF_Timer.Interval > 60000
|
|
|
|
|
#Else
|
|
|
|
|
GSF_Timer.Enabled = True
|
|
|
|
|
GSF_Timer.Enabled = GSF_Timer.Interval > 60000
|
|
|
|
|
#End If
|
|
|
|
|
|
|
|
|
|
DirectoryTimer.Interval = Params.DirectoryTimer_Intervall
|
|
|
|
|
@ -303,6 +305,32 @@ Public Class Service1
|
|
|
|
|
'''Indexdaten und Dokumente abgearbeitet sind.</para>
|
|
|
|
|
'''<para>Am Schluss der Verarbeitung wird der Systemfilewacher wieder
|
|
|
|
|
'''gestartet.</para></remarks>
|
|
|
|
|
'''
|
|
|
|
|
'''
|
|
|
|
|
Private nameDirection As SortOrder = SortOrder.Ascending
|
|
|
|
|
Private dateDirection As SortOrder = SortOrder.Ascending
|
|
|
|
|
Private Function CompareFileInfos(file1 As FileInfo, file2 As FileInfo) As Integer
|
|
|
|
|
Dim result = 0
|
|
|
|
|
|
|
|
|
|
'Select Case nameDirection
|
|
|
|
|
' Case SortOrder.Ascending
|
|
|
|
|
' result = file1.Name.CompareTo(file2.Name)
|
|
|
|
|
' Case SortOrder.Descending
|
|
|
|
|
' result = file2.Name.CompareTo(file1.Name)
|
|
|
|
|
'End Select
|
|
|
|
|
|
|
|
|
|
If result = 0 Then
|
|
|
|
|
Select Case dateDirection
|
|
|
|
|
Case SortOrder.Ascending
|
|
|
|
|
result = file1.LastWriteTime.CompareTo(file2.LastWriteTime)
|
|
|
|
|
Case SortOrder.Descending
|
|
|
|
|
result = file2.LastWriteTime.CompareTo(file1.LastWriteTime)
|
|
|
|
|
End Select
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Return result
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Private Sub Verarbeiten()
|
|
|
|
|
Dim gsffilename As String = ""
|
|
|
|
|
Try
|
|
|
|
|
@ -315,13 +343,16 @@ Public Class Service1
|
|
|
|
|
Dim looper As Boolean = True
|
|
|
|
|
While looper = True
|
|
|
|
|
'Alle .IND-Dateien im Verzeichnis auslesen
|
|
|
|
|
|
|
|
|
|
Dim clsindex As New clsIndexData()
|
|
|
|
|
Dim di As New IO.DirectoryInfo(Watch_Directory)
|
|
|
|
|
IntSleep(2)
|
|
|
|
|
Dim diar1 As IO.FileInfo() = di.GetFiles("*.ind")
|
|
|
|
|
Dim diar1 As IO.FileInfo() = di.GetFiles("*.ind")
|
|
|
|
|
Dim dra As IO.FileInfo
|
|
|
|
|
Array.Sort(diar1, AddressOf CompareFileInfos)
|
|
|
|
|
If diar1.Length = 0 Then
|
|
|
|
|
diar1 = di.GetFiles("*.xml")
|
|
|
|
|
Array.Sort(diar1, AddressOf CompareFileInfos)
|
|
|
|
|
If diar1.Length = 0 Then
|
|
|
|
|
looper = False
|
|
|
|
|
clsindex = Nothing
|
|
|
|
|
@ -402,9 +433,9 @@ Public Class Service1
|
|
|
|
|
End If
|
|
|
|
|
PrintOut("Ende File: " + fullname)
|
|
|
|
|
|
|
|
|
|
IntSleep(2)
|
|
|
|
|
IntSleep(5)
|
|
|
|
|
If Fehler <> 0 Then
|
|
|
|
|
Send_Error_Mail()
|
|
|
|
|
send_error_mail()
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
@ -890,7 +921,7 @@ Public Class Service1
|
|
|
|
|
Verarbeiten()
|
|
|
|
|
EventStopped = False
|
|
|
|
|
GSF = False
|
|
|
|
|
GSF_Timer.Enabled = True
|
|
|
|
|
GSF_Timer.Enabled = GSF_Timer.Interval > 60000
|
|
|
|
|
Catch
|
|
|
|
|
Finally
|
|
|
|
|
Params.Inputverzeichnis = saveInputVerzeichnis
|
|
|
|
|
@ -909,7 +940,7 @@ Public Class Service1
|
|
|
|
|
OBJ_GSF.Start_Checking()
|
|
|
|
|
OBJ_GSF.Sub_End()
|
|
|
|
|
FileWatch.EnableRaisingEvents = True
|
|
|
|
|
GSF_Timer.Enabled = True
|
|
|
|
|
GSF_Timer.Enabled = GSF_Timer.Interval > 60000
|
|
|
|
|
|
|
|
|
|
'20201114 - Verarbeitung der während GSF-Verarbeitung angelieferten Daten
|
|
|
|
|
DirectoryTimer_Elapsed(sender, e)
|
|
|
|
|
@ -934,7 +965,7 @@ Public Class Service1
|
|
|
|
|
Verarbeiten()
|
|
|
|
|
FileClose(99)
|
|
|
|
|
FileWatch.EnableRaisingEvents = True
|
|
|
|
|
GSF_Timer.Enabled = True
|
|
|
|
|
GSF_Timer.Enabled = GSF_Timer.Interval > 60000
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Sub Copyfiles(inputdir As String, outputdir As String)
|
|
|
|
|
|