Clean filename for temp files, centralize windream basepath

This commit is contained in:
Jonathan Jenne
2021-09-21 16:36:34 +02:00
parent ab2a0134f7
commit 9c0c31e141
11 changed files with 211 additions and 218 deletions

View File

@@ -5,6 +5,7 @@ Imports System.Text
Imports System.Globalization
Imports System.Threading
Imports System.Runtime.InteropServices
Imports DigitalData.Modules.Language
Public Class frmStart
Public _lizenzManager As ClassLicenseManager
@@ -160,7 +161,7 @@ Public Class frmStart
Try
ClassDatabase.Execute_non_Query($"DELETE FROM TBGI_FILES_USER WHERE WORKED = 1 AND UPPER(USER@WORK) = UPPER('{Environment.UserName}')")
For Each oFiledropString As String In ClassFileDrop.files_dropped
For Each oFiledropString As String In ClassFileDrop.FilesDropped
If oFiledropString IsNot Nothing Then
LOGGER.Info(">> Check Drop-File: " & oFiledropString.ToString)
Dim oLastPipe = oFiledropString.LastIndexOf("|")
@@ -211,11 +212,13 @@ Public Class frmStart
CURRENT_FILENAME = Filerow.Item("FILENAME2WORK")
CURRENT_WORKFILE_GUID = Filerow.Item(0)
CURRENT_WORKFILE = Filerow.Item("FILENAME2WORK")
CURRENT_WORKFILE_HASH = NotNull(Filerow.Item("FILE_HASH"), "")
CURRENT_WORKFILE_HASH = Utils.NotNull(Filerow.Item("FILE_HASH"), "")
LOGGER.Info(">> CURRENT_WORKFILE: " & CURRENT_WORKFILE)
If File.Exists(CURRENT_WORKFILE) = True And DTACTUAL_FILES.Rows.Count > 0 Then
Open_IndexDialog()
Else
Throw New FileNotFoundException("Dropped file does not exist anymore!")
End If
' If multi-indexing is active, all files have been indexed by now, so we can leave the loop
@@ -254,17 +257,6 @@ Public Class frmStart
MsgBox("Unexpected Error in Closing Application: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
EMAIL.Clear_TempFiles()
'TempDateien löschen
For Each oFile In TEMP_FILES
Try
System.IO.File.Delete(oFile)
Catch ex As Exception
LOGGER.Error(ex)
End Try
Next
Try
IndexForm.DisposeViewer()
IndexForm.Dispose()
@@ -613,14 +605,13 @@ Public Class frmStart
}
If oOpenFileDialog.ShowDialog() = DialogResult.OK Then
Dim i As Integer = 0
ClassFileDrop.files_dropped = Nothing
ClassFileDrop.FilesDropped.Clear()
For Each oFileName In oOpenFileDialog.FileNames
ReDim Preserve ClassFileDrop.files_dropped(i)
LOGGER.Info(">> Chosen File: " & oFileName)
ClassFileDrop.files_dropped(i) = "|DROPFROMFSYSTEM|" & oFileName
i += 1
ClassFileDrop.FilesDropped.Add("|DROPFROMFSYSTEM|" & oFileName)
Next
TimerCheckDroppedFiles.Start()
End If
Catch ex As Exception