WIP: Use ConfigManager

This commit is contained in:
Jonathan Jenne 2019-05-28 14:07:35 +02:00
parent e9135d3543
commit 2bd7ff9d2c
17 changed files with 418 additions and 248 deletions

2
.gitignore vendored
View File

@ -97,7 +97,7 @@ publish/
# NuGet Packages Directory # NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line ## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/ packages/
# Windows Azure Build Output # Windows Azure Build Output
csx csx

View File

@ -1,20 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="Global_Indexer.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="Global_Indexer.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup> </sectionGroup>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="Global_Indexer.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> <section name="Global_Indexer.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup> </sectionGroup>
</configSections> </configSections>
<connectionStrings> <connectionStrings>
<add name="Global_Indexer.My.MySettings.DD_ECMConnectionString" <add name="Global_Indexer.My.MySettings.DD_ECMConnectionString" connectionString="Data Source=172.24.12.41\TESTS;Initial Catalog=DD_ECM_TEST;Persist Security Info=True;User ID=sa;Password=dd" providerName="System.Data.SqlClient"/>
connectionString="Data Source=172.24.12.41\TESTS;Initial Catalog=DD_ECM_TEST;Persist Security Info=True;User ID=sa;Password=dd"
providerName="System.Data.SqlClient" />
</connectionStrings> </connectionStrings>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup> </startup>
<userSettings> <userSettings>
<Global_Indexer.My.MySettings> <Global_Indexer.My.MySettings>
@ -37,7 +35,7 @@
<value>False</value> <value>False</value>
</setting> </setting>
<setting name="REGEX_Replace" serializeAs="String"> <setting name="REGEX_Replace" serializeAs="String">
<value /> <value/>
</setting> </setting>
</Global_Indexer.My.MySettings> </Global_Indexer.My.MySettings>
</userSettings> </userSettings>
@ -48,4 +46,4 @@
</setting> </setting>
</Global_Indexer.My.MySettings> </Global_Indexer.My.MySettings>
</applicationSettings> </applicationSettings>
</configuration> </configuration>

View File

@ -0,0 +1,18 @@
Imports DigitalData.Modules.Config.ConfigAttributes
Public Class ClassConfig
<ConnectionString>
Public Property ConnectionString As String = ""
' Folderwatch
Public Property FolderWatchStarted As Boolean = False
Public Property FolderWatchScanStarted As Boolean = False
' PDF Viewer Settings
Public Property UniversalViewerPath As String = ""
Public Property FilePreview As Boolean = False
' Misc Settings
Public Property DeleteOriginalFile As Boolean = False
Public Property LogErrorsOnly As Boolean = True
End Class

View File

@ -18,7 +18,9 @@ Public Class ClassFolderWatcher
FolderWatcher.EnableRaisingEvents = True FolderWatcher.EnableRaisingEvents = True
AddHandler FolderWatcher.Created, AddressOf OnCreated AddHandler FolderWatcher.Created, AddressOf OnCreated
FW_started = True FW_started = True
SaveConfigValue("FW_started", "True") 'SaveConfigValue("FW_started", "True")
CONFIG.Config.FolderWatchStarted = True
CONFIG.Save()
End If End If
Catch ex As Exception Catch ex As Exception
ClassLogger.Add($"Error in Restart_FolderWatch: {ex.Message}", False) ClassLogger.Add($"Error in Restart_FolderWatch: {ex.Message}", False)
@ -37,7 +39,9 @@ Public Class ClassFolderWatcher
FolderWatcher_SCAN.EnableRaisingEvents = True FolderWatcher_SCAN.EnableRaisingEvents = True
AddHandler FolderWatcher_SCAN.Created, AddressOf OnCreated AddHandler FolderWatcher_SCAN.Created, AddressOf OnCreated
FWSCAN_started = True FWSCAN_started = True
SaveConfigValue("FWSCAN_started", "True") 'SaveConfigValue("FWSCAN_started", "True")
CONFIG.Config.FolderWatchScanStarted = True
CONFIG.Save()
End If End If
Catch ex As Exception Catch ex As Exception
ClassLogger.Add($"Error in Restart_FolderWatchSCAN: {ex.Message}", False) ClassLogger.Add($"Error in Restart_FolderWatchSCAN: {ex.Message}", False)
@ -56,7 +60,9 @@ Public Class ClassFolderWatcher
FolderWatcher.EnableRaisingEvents = True FolderWatcher.EnableRaisingEvents = True
AddHandler FolderWatcher.Created, AddressOf OnCreated AddHandler FolderWatcher.Created, AddressOf OnCreated
FW_started = True FW_started = True
SaveConfigValue("FW_started", "True") 'SaveConfigValue("FW_started", "True")
CONFIG.Config.FolderWatchStarted = True
CONFIG.Save()
Return 1 Return 1
End If End If
If FolderWatcher.EnableRaisingEvents = False Then If FolderWatcher.EnableRaisingEvents = False Then
@ -68,14 +74,18 @@ Public Class ClassFolderWatcher
FolderWatcher.EnableRaisingEvents = True FolderWatcher.EnableRaisingEvents = True
AddHandler FolderWatcher.Created, AddressOf OnCreated AddHandler FolderWatcher.Created, AddressOf OnCreated
FW_started = True FW_started = True
SaveConfigValue("FW_started", "True") 'SaveConfigValue("FW_started", "True")
CONFIG.Config.FolderWatchStarted = True
CONFIG.Save()
Return 1 Return 1
Else Else
'Gestartet also Stoppen 'Gestartet also Stoppen
FolderWatcher.EnableRaisingEvents = False FolderWatcher.EnableRaisingEvents = False
FW_started = False FW_started = False
ClassLogger.Add(" >> FolderWatch gestoppt", False) ClassLogger.Add(" >> FolderWatch gestoppt", False)
SaveConfigValue("FW_started", "False") 'SaveConfigValue("FW_started", "False")
CONFIG.Config.FolderWatchStarted = False
CONFIG.Save()
Return 0 Return 0
End If End If
'If watcher.EnableRaisingEvents = False Then 'If watcher.EnableRaisingEvents = False Then
@ -118,7 +128,9 @@ Public Class ClassFolderWatcher
FolderWatcher_SCAN.EnableRaisingEvents = True FolderWatcher_SCAN.EnableRaisingEvents = True
AddHandler FolderWatcher_SCAN.Created, AddressOf OnCreated AddHandler FolderWatcher_SCAN.Created, AddressOf OnCreated
FWSCAN_started = True FWSCAN_started = True
SaveConfigValue("FWSCAN_started", "True") 'SaveConfigValue("FWSCAN_started", "True")
CONFIG.Config.FolderWatchScanStarted = True
CONFIG.Save()
Return 1 Return 1
End If End If
If FolderWatcher_SCAN.EnableRaisingEvents = False Then If FolderWatcher_SCAN.EnableRaisingEvents = False Then
@ -130,14 +142,18 @@ Public Class ClassFolderWatcher
FolderWatcher_SCAN.EnableRaisingEvents = True FolderWatcher_SCAN.EnableRaisingEvents = True
AddHandler FolderWatcher_SCAN.Created, AddressOf OnCreated AddHandler FolderWatcher_SCAN.Created, AddressOf OnCreated
FWSCAN_started = True FWSCAN_started = True
SaveConfigValue("FWSCAN_started", "True") 'SaveConfigValue("FWSCAN_started", "True")
CONFIG.Config.FolderWatchScanStarted = True
CONFIG.Save()
Return 1 Return 1
Else Else
'Gestartet also Stoppen 'Gestartet also Stoppen
FolderWatcher_SCAN.EnableRaisingEvents = False FolderWatcher_SCAN.EnableRaisingEvents = False
FWSCAN_started = False FWSCAN_started = False
ClassLogger.Add(" >> FolderWatch Scan gestoppt", False) ClassLogger.Add(" >> FolderWatch Scan gestoppt", False)
SaveConfigValue("FWSCAN_started", "False") 'SaveConfigValue("FWSCAN_started", "False")
CONFIG.Config.FolderWatchScanStarted = False
CONFIG.Save()
Return 0 Return 0
End If End If
@ -152,7 +168,9 @@ Public Class ClassFolderWatcher
FolderWatcher.EnableRaisingEvents = False FolderWatcher.EnableRaisingEvents = False
FW_started = False FW_started = False
ClassLogger.Add(" >> FolderWatch gestoppt", False) ClassLogger.Add(" >> FolderWatch gestoppt", False)
SaveConfigValue("FW_started", "False") 'SaveConfigValue("FW_started", "False")
CONFIG.Config.FolderWatchStarted = True
CONFIG.Save()
Return True Return True
Else Else
Return False Return False

View File

@ -1,5 +1,7 @@
Imports System.ComponentModel Imports System.ComponentModel
Imports DLLLicenseManager Imports DLLLicenseManager
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Config
Public Class ClassInit Public Class ClassInit
Public _lizenzManager As ClassLicenseManager Public _lizenzManager As ClassLicenseManager
@ -10,12 +12,27 @@ Public Class ClassInit
ClassLogger.Init("", Environment.UserName) ClassLogger.Init("", Environment.UserName)
ClassLogger.Add(">> Programmstart: " & Now, False) ClassLogger.Add(">> Programmstart: " & Now, False)
ClassLogger.Add(">> Username: " & Environment.UserName, False) ClassLogger.Add(">> Username: " & Environment.UserName, False)
'Throw New Exception("Dummy Fehler!") LOGCONFIG = New LogConfig(LogConfig.PathType.AppData)
LOGGER = LOGCONFIG.GetLogger("Globix")
LOGGER.Info("Programmstart")
LOGGER.Info("Username: {0}", Environment.UserName)
End Sub
Public Sub InitConfig()
CONFIG = New ConfigManager(Of ClassConfig)(LOGCONFIG, Application.UserAppDataPath, Application.CommonAppDataPath)
MyConnectionString = DecryptConnectionString(CONFIG.Config.ConnectionString)
LogErrorsOnly = CONFIG.Config.LogErrorsOnly
Preview = CONFIG.Config.FilePreview
UniversalViewer_Path = CONFIG.Config.UniversalViewerPath
FW_started = CONFIG.Config.FolderWatchStarted
FWSCAN_started = CONFIG.Config.FolderWatchScanStarted
CURR_DELETE_ORIGIN = CONFIG.Config.DeleteOriginalFile
End Sub End Sub
Public Function InitDatabase() Public Function InitDatabase()
Dim dbResult As Boolean Dim dbResult As Boolean
LoadMyConfig() 'LoadMyConfig()
If LoadFileExclusion() = False Then If LoadFileExclusion() = False Then
If USER_LANGUAGE = "de-DE" Then If USER_LANGUAGE = "de-DE" Then
MsgBox("Die Ausschlusskriterien für Dateien in Folderwatch konnten nicht angelegt werden!", MsgBoxStyle.Information) MsgBox("Die Ausschlusskriterien für Dateien in Folderwatch konnten nicht angelegt werden!", MsgBoxStyle.Information)
@ -43,7 +60,7 @@ Public Class ClassInit
Return True Return True
End If End If
End Function End Function
<STAThread()> _ <STAThread()>
Public Sub InitBasics() Public Sub InitBasics()
Dim configResult As Boolean Dim configResult As Boolean
configResult = Load_BasicConfig() configResult = Load_BasicConfig()
@ -56,6 +73,25 @@ Public Class ClassInit
End If End If
End If End If
End Sub End Sub
Public Function Load_BasicConfig()
Try
ClassDatabase.Init()
Dim sql As String = "select * from tbdd_Modules where NAME = 'Global-Indexer'"
Dim DT As DataTable = ClassDatabase.Return_Datatable(sql)
If DT.Rows.Count = 1 Then
GI_withWindream = DT.Rows(0).Item("BIT1")
vWLaufwerk = DT.Rows(0).Item("STRING1")
Else
Return False
End If
Catch ex As Exception
MsgBox("Error in Load_BasicConfig" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
Return False
End Try
Return True
End Function
Public Sub Init_Folderwatch() Public Sub Init_Folderwatch()
Try Try
Dim sql As String = "SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'DEFAULT' AND USER_ID = " & USER_ID Dim sql As String = "SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'DEFAULT' AND USER_ID = " & USER_ID
@ -66,14 +102,18 @@ Public Class ClassInit
If folderwatchPath = String.Empty Then If folderwatchPath = String.Empty Then
ClassLogger.Add("Init_Folderwatch: folderwatchPath is empty", True) ClassLogger.Add("Init_Folderwatch: folderwatchPath is empty", True)
FW_started = False FW_started = False
SaveConfigValue("FW_started", "False") 'SaveConfigValue("FW_started", "False")
CONFIG.Config.FolderWatchStarted = False
CONFIG.Save()
Exit Sub Exit Sub
End If End If
If Not IO.Directory.Exists(folderwatchPath) Then If Not IO.Directory.Exists(folderwatchPath) Then
ClassLogger.Add("Init_Folderwatch: folderwatchPath does not exists or is invalid path", True) ClassLogger.Add("Init_Folderwatch: folderwatchPath does not exists or is invalid path", True)
FW_started = False FW_started = False
SaveConfigValue("FW_started", "False") 'SaveConfigValue("FW_started", "False")
CONFIG.Config.FolderWatchStarted = False
CONFIG.Save()
Exit Sub Exit Sub
End If End If
@ -97,14 +137,18 @@ Public Class ClassInit
If folderwatchScanPath = String.Empty Then If folderwatchScanPath = String.Empty Then
ClassLogger.Add("Init_Folderwatch: folderwatchScanPath is empty", True) ClassLogger.Add("Init_Folderwatch: folderwatchScanPath is empty", True)
FWSCAN_started = False FWSCAN_started = False
SaveConfigValue("FW_started", "False") 'SaveConfigValue("FW_started", "False")
CONFIG.Config.FolderWatchStarted = False
CONFIG.Save()
Exit Sub Exit Sub
End If End If
If Not IO.Directory.Exists(folderwatchScanPath) Then If Not IO.Directory.Exists(folderwatchScanPath) Then
ClassLogger.Add("Init_Folderwatch: folderwatchScanPath does not exists or is invalid path", True) ClassLogger.Add("Init_Folderwatch: folderwatchScanPath does not exists or is invalid path", True)
FWSCAN_started = False FWSCAN_started = False
SaveConfigValue("FW_started", "False") 'SaveConfigValue("FW_started", "False")
CONFIG.Config.FolderWatchStarted = False
CONFIG.Save()
Exit Sub Exit Sub
End If End If
@ -245,7 +289,29 @@ Public Class ClassInit
MsgBox(ex.Message, MsgBoxStyle.Critical) MsgBox(ex.Message, MsgBoxStyle.Critical)
START_INCOMPLETE = True START_INCOMPLETE = True
End Try End Try
End Sub End Sub
Private Function DecryptConnectionString(EncryptedConnectionString As String) As String
Dim oBuilder As New SqlClient.SqlConnectionStringBuilder With {
.ConnectionString = EncryptedConnectionString
}
If oBuilder.ConnectionString.Contains("Password=") Then
Dim oPlaintextPassword As String
Dim oDecryptor As New ClassEncryption("!35452didalog=")
Try
oPlaintextPassword = oDecryptor.DecryptData(oBuilder.Password)
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Debug("Password {0} could not be decrypted. Assuming plaintext password.")
oPlaintextPassword = oBuilder.Password
End Try
Return EncryptedConnectionString.Replace(oBuilder.Password, oPlaintextPassword)
Else
Return EncryptedConnectionString
End If
End Function
End Class End Class

View File

@ -11,7 +11,7 @@
<AssemblyName>Global_Indexer</AssemblyName> <AssemblyName>Global_Indexer</AssemblyName>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<MyType>WindowsForms</MyType> <MyType>WindowsForms</MyType>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<PublishUrl>publish\</PublishUrl> <PublishUrl>publish\</PublishUrl>
<Install>true</Install> <Install>true</Install>
@ -28,6 +28,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper> <IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@ -143,6 +144,15 @@
<Reference Include="DevExpress.XtraTreeList.v15.2, Version=15.2.16.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL"> <Reference Include="DevExpress.XtraTreeList.v15.2, Version=15.2.16.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
</Reference> </Reference>
<Reference Include="DigitalData.Modules.Config">
<HintPath>..\..\DDMonorepo\Modules.Config\bin\Debug\DigitalData.Modules.Config.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Filesystem">
<HintPath>..\..\DDMonorepo\Modules.Config\bin\Debug\DigitalData.Modules.Filesystem.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Logging">
<HintPath>..\..\DDMonorepo\Modules.Config\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
</Reference>
<Reference Include="DLLLicenseManager, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="DLLLicenseManager, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>P:\Visual Studio Projekte\Bibliotheken\DLLLicenseManager.dll</HintPath> <HintPath>P:\Visual Studio Projekte\Bibliotheken\DLLLicenseManager.dll</HintPath>
@ -159,6 +169,10 @@
<HintPath>P:\Visual Studio Projekte\Bibliotheken\windream\Interop.WMOTOOLLib.dll</HintPath> <HintPath>P:\Visual Studio Projekte\Bibliotheken\windream\Interop.WMOTOOLLib.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes> <EmbedInteropTypes>True</EmbedInteropTypes>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NLog.4.5.11\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="Oracle.ManagedDataAccess"> <Reference Include="Oracle.ManagedDataAccess">
<HintPath>P:\Visual Studio Projekte\Bibliotheken\Oracle.ManagedDataAccess.dll</HintPath> <HintPath>P:\Visual Studio Projekte\Bibliotheken\Oracle.ManagedDataAccess.dll</HintPath>
</Reference> </Reference>
@ -200,6 +214,7 @@
<Compile Include="AboutBox1.vb"> <Compile Include="AboutBox1.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="ClassConfig.vb" />
<Compile Include="ClassConstants.vb" /> <Compile Include="ClassConstants.vb" />
<Compile Include="ClassControls.vb" /> <Compile Include="ClassControls.vb" />
<Compile Include="ClassDatabase.vb" /> <Compile Include="ClassDatabase.vb" />
@ -594,6 +609,7 @@
</COMReference> </COMReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="packages.config" />
<None Include="Resources\database_refresh.png" /> <None Include="Resources\database_refresh.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,4 +1,7 @@
Module ModuleCURRENT Imports DigitalData.Modules.Config
Imports DigitalData.Modules.Logging
Module ModuleCURRENT
Public ERROR_STATE As String Public ERROR_STATE As String
Public START_INCOMPLETE As Boolean = False Public START_INCOMPLETE As Boolean = False
Public CURRENT_FILENAME As String Public CURRENT_FILENAME As String
@ -7,6 +10,10 @@
Public CURRENT_WORKFILE As String Public CURRENT_WORKFILE As String
Public CURR_WORKFILE_EXTENSION As String Public CURR_WORKFILE_EXTENSION As String
Public CONFIG As ConfigManager(Of ClassConfig)
Public LOGCONFIG As LogConfig
Public LOGGER As Logger
Public CURRENT_DOKART_ID As Integer Public CURRENT_DOKART_ID As Integer
Public CURRENT_DOKART_DUPLICATE_HANDLING As String = "Default" Public CURRENT_DOKART_DUPLICATE_HANDLING As String = "Default"
Public CURRENT_LASTDOKART As String = "" Public CURRENT_LASTDOKART As String = ""

View File

@ -15,217 +15,239 @@ Module ModuleMySettings
Public FW_started As Boolean = False Public FW_started As Boolean = False
Public FWSCAN_started As Boolean = False Public FWSCAN_started As Boolean = False
Public Function GetUserConfigPath() As String 'Public Function GetUserConfigPath() As String
Return Path.Combine(Application.UserAppDataPath(), USER_CONFIG_FILE) ' Return Path.Combine(Application.UserAppDataPath(), USER_CONFIG_FILE)
End Function 'End Function
Public Function GetAllUsersConfigPath() As String 'Public Function GetAllUsersConfigPath() As String
Return Path.Combine(Application.CommonAppDataPath(), COMPUTER_CONFIG_FILE) ' Return Path.Combine(Application.CommonAppDataPath(), COMPUTER_CONFIG_FILE)
End Function 'End Function
Public Function GetCurrentConfigPath() As String 'Public Function GetCurrentConfigPath() As String
If File.Exists(GetUserConfigPath()) Then ' If File.Exists(GetUserConfigPath()) Then
Return GetUserConfigPath() ' Return GetUserConfigPath()
Else ' Else
Return GetAllUsersConfigPath() ' Return GetAllUsersConfigPath()
End If ' End If
End Function 'End Function
Public Function LoadMyConfig() 'Public Function LoadMyConfig()
Dim rowresult As String = "" ' Dim rowresult As String = ""
Try ' Try
Dim oDatatable As DataTable ' Dim oDatatable As DataTable
''if file doesn't exist, create the file with its default xml table ' ''if file doesn't exist, create the file with its default xml table
'If Not File.Exists(ConfigPath) Then ' 'If Not File.Exists(ConfigPath) Then
' DT = CreateConfigTable() ' ' DT = CreateConfigTable()
' DT.WriteXml(ConfigPath) ' ' DT.WriteXml(ConfigPath)
'End If ' 'End If
'DT = GetTablefromXML() ' 'DT = GetTablefromXML()
' if file in %APPDATA% doesn't exist, ' ' if file in %APPDATA% doesn't exist,
' check for file in %ALLUSERSPROFILE%, ' ' check for file in %ALLUSERSPROFILE%,
' otherwise create the file with its default xml table ' ' otherwise create the file with its default xml table
If File.Exists(GetUserConfigPath()) Then ' If File.Exists(GetUserConfigPath()) Then
oDatatable = GetTablefromXML(GetUserConfigPath()) ' oDatatable = GetTablefromXML(GetUserConfigPath())
ElseIf File.Exists(GetAllUsersConfigPath()) Then ' ElseIf File.Exists(GetAllUsersConfigPath()) Then
oDatatable = GetTablefromXML(GetAllUsersConfigPath()) ' oDatatable = GetTablefromXML(GetAllUsersConfigPath())
Else ' Else
oDatatable = CreateConfigTable() ' oDatatable = CreateConfigTable()
oDatatable.WriteXml(GetUserConfigPath()) ' oDatatable.WriteXml(GetUserConfigPath())
End If ' End If
For Each Row As DataRow In oDatatable.Rows ' For Each Row As DataRow In oDatatable.Rows
rowresult &= Row.Item("ConfigName") ' rowresult &= Row.Item("ConfigName")
Select Case Row.Item("ConfigName") ' Select Case Row.Item("ConfigName")
Case "MyConnectionString" ' Case "MyConnectionString"
Dim connstring As String ' Dim connstring As String
'Den ConnectonString mit verschlüsseltem PW laden ' 'Den ConnectonString mit verschlüsseltem PW laden
Dim csb As New SqlClient.SqlConnectionStringBuilder ' Dim csb As New SqlClient.SqlConnectionStringBuilder
csb.ConnectionString = Row.Item("Value") ' csb.ConnectionString = Row.Item("Value")
If csb.ConnectionString.Contains("Password=") Then ' If csb.ConnectionString.Contains("Password=") Then
'SA-Auth ' 'SA-Auth
'Jetzt das Passwort entschlüsseln ' 'Jetzt das Passwort entschlüsseln
Dim PWplainText As String ' Dim PWplainText As String
Dim wrapper As New ClassEncryption("!35452didalog=") ' Dim wrapper As New ClassEncryption("!35452didalog=")
' DecryptData throws if the wrong password is used. ' ' DecryptData throws if the wrong password is used.
Try ' Try
PWplainText = wrapper.DecryptData(csb.Password) ' PWplainText = wrapper.DecryptData(csb.Password)
Catch ex As Exception ' Catch ex As Exception
ClassLogger.Add("- the Password '" & csb.Password & "' could not be decrypted", False) ' ClassLogger.Add("- the Password '" & csb.Password & "' could not be decrypted", False)
PWplainText = csb.Password ' PWplainText = csb.Password
End Try ' End Try
connstring = Row.Item("Value").ToString.Replace(csb.Password, PWplainText) ' connstring = Row.Item("Value").ToString.Replace(csb.Password, PWplainText)
Else ' Else
'Win-Auth ' 'Win-Auth
connstring = Row.Item("Value").ToString ' connstring = Row.Item("Value").ToString
End If ' End If
MyConnectionString = connstring ' MyConnectionString = connstring
Case "LogErrorsOnly" ' Case "LogErrorsOnly"
LogErrorsOnly = CBool(Row.Item("Value")) ' LogErrorsOnly = CBool(Row.Item("Value"))
Case "Preview" ' Case "Preview"
Preview = CBool(Row.Item("Value")) ' Preview = CBool(Row.Item("Value"))
Case "UniversalViewer" ' Case "UniversalViewer"
UniversalViewer_Path = Row.Item("Value") ' UniversalViewer_Path = Row.Item("Value")
Case "FW_started" ' Case "FW_started"
FW_started = CBool(Row.Item("Value")) ' FW_started = CBool(Row.Item("Value"))
Case "FWSCAN_started" ' Case "FWSCAN_started"
FWSCAN_started = CBool(Row.Item("Value")) ' FWSCAN_started = CBool(Row.Item("Value"))
Case "Delete_OriginFile" ' Case "Delete_OriginFile"
CURR_DELETE_ORIGIN = CBool(Row.Item("Value")) ' CURR_DELETE_ORIGIN = CBool(Row.Item("Value"))
End Select ' End Select
Next ' Next
'update 1.1 ' 'update 1.1
If rowresult.Contains("FW_started") = False Then ' If rowresult.Contains("FW_started") = False Then
Dim newRow As DataRow = oDatatable.NewRow() ' Dim newRow As DataRow = oDatatable.NewRow()
newRow("ConfigName") = "FW_started" ' newRow("ConfigName") = "FW_started"
newRow("Value") = "False" ' newRow("Value") = "False"
oDatatable.Rows.Add(newRow) ' oDatatable.Rows.Add(newRow)
oDatatable.WriteXml(GetUserConfigPath()) ' oDatatable.WriteXml(GetUserConfigPath())
End If ' End If
'update 1.6 ' 'update 1.6
If rowresult.Contains("Delete_OriginFile") = False Then ' If rowresult.Contains("Delete_OriginFile") = False Then
Dim newRow As DataRow = oDatatable.NewRow() ' Dim newRow As DataRow = oDatatable.NewRow()
newRow("ConfigName") = "Delete_OriginFile" ' newRow("ConfigName") = "Delete_OriginFile"
newRow("Value") = "False" ' newRow("Value") = "False"
oDatatable.Rows.Add(newRow) ' oDatatable.Rows.Add(newRow)
oDatatable.WriteXml(GetUserConfigPath()) ' oDatatable.WriteXml(GetUserConfigPath())
End If ' End If
If rowresult.Contains("FWSCAN_started") = False Then ' If rowresult.Contains("FWSCAN_started") = False Then
Dim newRow As DataRow = oDatatable.NewRow() ' Dim newRow As DataRow = oDatatable.NewRow()
newRow("ConfigName") = "FWSCAN_started" ' newRow("ConfigName") = "FWSCAN_started"
newRow("Value") = "False" ' newRow("Value") = "False"
oDatatable.Rows.Add(newRow) ' oDatatable.Rows.Add(newRow)
oDatatable.WriteXml(GetUserConfigPath()) ' oDatatable.WriteXml(GetUserConfigPath())
End If ' End If
Catch ex As Exception ' Catch ex As Exception
MsgBox("Error in MySettings-LoadMyConfig" & vbNewLine & ex.Message, MsgBoxStyle.Critical) ' MsgBox("Error in MySettings-LoadMyConfig" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
Return False ' Return False
End Try ' End Try
Return True ' Return True
End Function 'End Function
Private Function GetTablefromXML(ConfigPath As String) 'Private Function GetTablefromXML(ConfigPath As String)
Try ' Try
Dim DS As New DataSet ' Dim DS As New DataSet
DS.ReadXml(ConfigPath) ' DS.ReadXml(ConfigPath)
Return DS.Tables(0) ' Return DS.Tables(0)
Catch ex As Exception ' Catch ex As Exception
MsgBox("Error in GetTablefromXML" & vbNewLine & ex.Message, MsgBoxStyle.Critical) ' MsgBox("Error in GetTablefromXML" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
Return Nothing ' Return Nothing
End Try ' End Try
End Function 'End Function
Private Function CreateConfigTable() As DataTable 'Private Function CreateConfigTable() As DataTable
Try ' Try
' Create sample Customers table, in order ' ' Create sample Customers table, in order
' to demonstrate the behavior of the DataTableReader. ' ' to demonstrate the behavior of the DataTableReader.
Dim oTable As New DataTable ' Dim oTable As New DataTable
oTable.TableName = "MyConfig" ' oTable.TableName = "MyConfig"
' Create two columns, ID and Name. ' ' Create two columns, ID and Name.
Dim oIdColumn As DataColumn = oTable.Columns.Add("ID", ' Dim oIdColumn As DataColumn = oTable.Columns.Add("ID",
GetType(System.Int32)) ' GetType(System.Int32))
oIdColumn.AutoIncrement = True ' oIdColumn.AutoIncrement = True
oIdColumn.AutoIncrementSeed = 0 ' oIdColumn.AutoIncrementSeed = 0
oIdColumn.AutoIncrementStep = 1 ' oIdColumn.AutoIncrementStep = 1
oTable.Columns.Add("ConfigName", GetType(System.String)) ' oTable.Columns.Add("ConfigName", GetType(System.String))
oTable.Columns.Add("Value", GetType(System.String)) ' oTable.Columns.Add("Value", GetType(System.String))
'Set the ID column as the primary key column. ' 'Set the ID column as the primary key column.
oTable.PrimaryKey = New DataColumn() {oIdColumn} ' oTable.PrimaryKey = New DataColumn() {oIdColumn}
Dim newRow As DataRow = oTable.NewRow() ' Dim newRow As DataRow = oTable.NewRow()
newRow("ConfigName") = "MyConnectionString" ' newRow("ConfigName") = "MyConnectionString"
newRow("Value") = "" ' newRow("Value") = ""
oTable.Rows.Add(newRow) ' oTable.Rows.Add(newRow)
Dim newRow1 As DataRow = oTable.NewRow() ' Dim newRow1 As DataRow = oTable.NewRow()
newRow1("ConfigName") = "LogErrorsOnly" ' newRow1("ConfigName") = "LogErrorsOnly"
newRow1("Value") = "True" ' newRow1("Value") = "True"
oTable.Rows.Add(newRow1) ' oTable.Rows.Add(newRow1)
Dim newRow2 As DataRow = oTable.NewRow() ' Dim newRow2 As DataRow = oTable.NewRow()
newRow2("ConfigName") = "Preview" ' newRow2("ConfigName") = "Preview"
newRow2("Value") = "True" ' newRow2("Value") = "True"
oTable.Rows.Add(newRow2) ' oTable.Rows.Add(newRow2)
Dim newRow3 As DataRow = oTable.NewRow() ' Dim newRow3 As DataRow = oTable.NewRow()
newRow3("ConfigName") = "UniversalViewer" ' newRow3("ConfigName") = "UniversalViewer"
newRow3("Value") = "" ' newRow3("Value") = ""
oTable.Rows.Add(newRow3) ' oTable.Rows.Add(newRow3)
Dim newRow4 As DataRow = oTable.NewRow() ' Dim newRow4 As DataRow = oTable.NewRow()
newRow4("ConfigName") = "FW_started" ' newRow4("ConfigName") = "FW_started"
newRow4("Value") = "False" ' newRow4("Value") = "False"
oTable.Rows.Add(newRow4) ' oTable.Rows.Add(newRow4)
Dim newRow5 As DataRow = oTable.NewRow() ' Dim newRow5 As DataRow = oTable.NewRow()
newRow5("ConfigName") = "FWSCAN_started" ' newRow5("ConfigName") = "FWSCAN_started"
newRow5("Value") = "False" ' newRow5("Value") = "False"
oTable.Rows.Add(newRow5) ' oTable.Rows.Add(newRow5)
oTable.AcceptChanges() ' oTable.AcceptChanges()
Return oTable ' Return oTable
Catch ex As Exception ' Catch ex As Exception
MsgBox("Error in CreateConfigTable" & vbNewLine & ex.Message, MsgBoxStyle.Critical) ' MsgBox("Error in CreateConfigTable" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
Return Nothing ' Return Nothing
End Try ' End Try
End Function 'End Function
''' <summary> '''' <summary>
''' Save settings to user config, NOT to common config '''' Save settings to user config, NOT to common config
''' </summary> '''' </summary>
Public Function SaveConfigValue(name As String, value As String) 'Public Function SaveConfigValue(name As String, value As String)
Try ' Try
Dim oUserConfigPath = GetUserConfigPath() ' Dim oUserConfigPath = GetUserConfigPath()
Dim oCurrentConfigPath = GetCurrentConfigPath() ' Dim oCurrentConfigPath = GetCurrentConfigPath()
Dim oDatatable As DataTable = GetTablefromXML(oCurrentConfigPath) ' Dim oDatatable As DataTable = GetTablefromXML(oCurrentConfigPath)
For Each Row As DataRow In oDatatable.Rows ' For Each Row As DataRow In oDatatable.Rows
If Row.Item("ConfigName") = name Then ' If Row.Item("ConfigName") = name Then
Row.Item("Value") = value ' Row.Item("Value") = value
End If ' End If
Next ' Next
oDatatable.AcceptChanges() ' oDatatable.AcceptChanges()
oDatatable.WriteXml(oUserConfigPath) ' oDatatable.WriteXml(oUserConfigPath)
Return True ' Return True
Catch ex As Exception ' Catch ex As Exception
MsgBox("Error in SaveConfigValue" & vbNewLine & ex.Message, MsgBoxStyle.Critical) ' MsgBox("Error in SaveConfigValue" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
Return False ' Return False
End Try ' End Try
End Function 'End Function
Public Function Load_BasicConfig() 'Public Function Load_BasicConfig()
Try ' Try
ClassDatabase.Init() ' ClassDatabase.Init()
Dim sql As String = "select * from tbdd_Modules where NAME = 'Global-Indexer'" ' Dim sql As String = "select * from tbdd_Modules where NAME = 'Global-Indexer'"
Dim DT As DataTable = ClassDatabase.Return_Datatable(sql) ' Dim DT As DataTable = ClassDatabase.Return_Datatable(sql)
If DT.Rows.Count = 1 Then ' If DT.Rows.Count = 1 Then
GI_withWindream = DT.Rows(0).Item("BIT1") ' GI_withWindream = DT.Rows(0).Item("BIT1")
vWLaufwerk = DT.Rows(0).Item("STRING1") ' vWLaufwerk = DT.Rows(0).Item("STRING1")
Else ' Else
Return False ' Return False
End If ' End If
Catch ex As Exception ' Catch ex As Exception
MsgBox("Error in Load_BasicConfig" & vbNewLine & ex.Message, MsgBoxStyle.Critical) ' MsgBox("Error in Load_BasicConfig" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
Return False ' Return False
End Try ' End Try
Return True ' Return True
End Function 'End Function
'Private Function DecryptConnectionString(EncryptedConnectionString As String) As String
' Dim oBuilder As New SqlClient.SqlConnectionStringBuilder With {
' .ConnectionString = EncryptedConnectionString
' }
' If oBuilder.ConnectionString.Contains("Password=") Then
' Dim oPlaintextPassword As String
' Dim oDecryptor As New ClassEncryption("!35452didalog=")
' Try
' oPlaintextPassword = oDecryptor.DecryptData(oBuilder.Password)
' Catch ex As Exception
' LOGGER.Error(ex)
' LOGGER.Debug("Password {0} could not be decrypted. Assuming plaintext password.")
' oPlaintextPassword = oBuilder.Password
' End Try
' Return EncryptedConnectionString.Replace(oBuilder.Password, oPlaintextPassword)
' Else
' Return EncryptedConnectionString
' End If
'End Function
End Module End Module

View File

@ -1,7 +1,7 @@
'------------------------------------------------------------------------------ '------------------------------------------------------------------------------
' <auto-generated> ' <auto-generated>
' Dieser Code wurde von einem Tool generiert. ' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:4.0.30319.34209 ' Laufzeitversion:4.0.30319.42000
' '
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn ' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird. ' der Code erneut generiert wird.
@ -14,8 +14,8 @@ Option Explicit On
Namespace My Namespace My
'HINWEIS: Diese Datei wird automatisch generiert. Ändern Sie sie nicht direkt. Zum Ändern 'HINWEIS: Diese Datei wird automatisch generiert und darf nicht direkt bearbeitet werden. Wenn Sie Änderungen vornehmen möchten
' oder bei in dieser Datei auftretenden Buildfehlern wechseln Sie zum Projekt-Designer. ' oder in dieser Datei Buildfehler auftreten, wechseln Sie zum Projekt-Designer.
' (Wechseln Sie dazu zu den Projekteigenschaften, oder doppelklicken Sie auf den Knoten "Mein Projekt" im ' (Wechseln Sie dazu zu den Projekteigenschaften, oder doppelklicken Sie auf den Knoten "Mein Projekt" im
' Projektmappen-Explorer). Nehmen Sie auf der Registerkarte "Anwendung" entsprechende Änderungen vor. ' Projektmappen-Explorer). Nehmen Sie auf der Registerkarte "Anwendung" entsprechende Änderungen vor.
' '

View File

@ -1,7 +1,7 @@
'------------------------------------------------------------------------------ '------------------------------------------------------------------------------
' <auto-generated> ' <auto-generated>
' Dieser Code wurde von einem Tool generiert. ' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:4.0.30319.34209 ' Laufzeitversion:4.0.30319.42000
' '
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn ' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird. ' der Code erneut generiert wird.
@ -22,7 +22,7 @@ Namespace My.Resources
'''<summary> '''<summary>
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. ''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
'''</summary> '''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _

View File

@ -15,7 +15,7 @@ Option Explicit On
Namespace My Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.5.0.0"), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase Inherits Global.System.Configuration.ApplicationSettingsBase

View File

@ -22,7 +22,7 @@ Namespace My.Resources
'''<summary> '''<summary>
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. ''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
'''</summary> '''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Class _frmLicense Friend Class _frmLicense

View File

@ -58,7 +58,9 @@ Public Class frmConfig_Basic
Dim pw As String = cipherText Dim pw As String = cipherText
constring = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & pw & ";" constring = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & pw & ";"
End If End If
SaveConfigValue("MyConnectionString", constring) 'SaveConfigValue("MyConnectionString", constring)
CONFIG.Config.ConnectionString = constring
CONFIG.Save()
Me.txtActualConnection.Text = constring Me.txtActualConnection.Text = constring
@ -122,7 +124,9 @@ Public Class frmConfig_Basic
End Sub End Sub
Private Sub frmConfig_Basic_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing Private Sub frmConfig_Basic_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
SaveConfigValue("UniversalViewer", txtuniversalViewer.Text) 'SaveConfigValue("UniversalViewer", txtuniversalViewer.Text)
CONFIG.Config.UniversalViewerPath = txtuniversalViewer.Text
CONFIG.Save()
End Sub End Sub
<STAThread()> _ <STAThread()> _
Private Sub frmConfig_Basic_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub frmConfig_Basic_Load(sender As Object, e As EventArgs) Handles MyBase.Load
@ -153,8 +157,10 @@ Public Class frmConfig_Basic
If .ShowDialog() = DialogResult.OK Then If .ShowDialog() = DialogResult.OK Then
Me.txtuniversalViewer.Text = .FileName Me.txtuniversalViewer.Text = .FileName
SaveConfigValue("UniversalViewer", txtuniversalViewer.Text) 'SaveConfigValue("UniversalViewer", txtuniversalViewer.Text)
UniversalViewer_Path = txtuniversalViewer.Text UniversalViewer_Path = txtuniversalViewer.Text
CONFIG.Config.UniversalViewerPath = txtuniversalViewer.Text
CONFIG.Save()
End If End If
End With End With
Catch ex As Exception Catch ex As Exception
@ -271,11 +277,15 @@ Public Class frmConfig_Basic
ClassDatabase.Execute_non_Query("DELETE FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & USER_ID & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'", True) ClassDatabase.Execute_non_Query("DELETE FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & USER_ID & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'", True)
If FOLDER_TYPE = "SCAN" Then If FOLDER_TYPE = "SCAN" Then
CURRENT_SCAN_FOLDERWATCH = "" CURRENT_SCAN_FOLDERWATCH = ""
SaveConfigValue("FWSCAN_started", "False") 'SaveConfigValue("FWSCAN_started", "False")
CONFIG.Config.FolderWatchScanStarted = False
CONFIG.Save()
FWSCAN_started = False FWSCAN_started = False
Else Else
FW_started = False FW_started = False
SaveConfigValue("FW_started", "False") 'SaveConfigValue("FW_started", "False")
CONFIG.Config.FolderWatchStarted = False
CONFIG.Save()
CURRENT_FOLDERWATCH = "" CURRENT_FOLDERWATCH = ""
End If End If
@ -389,7 +399,9 @@ Public Class frmConfig_Basic
Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles chkLogErrorsOnly.CheckedChanged Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles chkLogErrorsOnly.CheckedChanged
If formloaded = True Then If formloaded = True Then
SaveConfigValue("LogErrorsOnly", chkLogErrorsOnly.Checked) CONFIG.Config.LogErrorsOnly = chkLogErrorsOnly.Checked
CONFIG.Save()
'SaveConfigValue("LogErrorsOnly", chkLogErrorsOnly.Checked)
ClassLogger.Add(" >> LogErrorsOnly changed to '" & chkLogErrorsOnly.Checked, False) ClassLogger.Add(" >> LogErrorsOnly changed to '" & chkLogErrorsOnly.Checked, False)
LogErrorsOnly = chkLogErrorsOnly.Checked LogErrorsOnly = chkLogErrorsOnly.Checked
End If End If

View File

@ -2702,7 +2702,9 @@ Public Class frmIndex
Return utf8Encoding.GetString(encodedString) Return utf8Encoding.GetString(encodedString)
End Function End Function
Private Sub CheckBox1_CheckedChanged(sender As System.Object, e As System.EventArgs) Private Sub CheckBox1_CheckedChanged(sender As System.Object, e As System.EventArgs)
SaveConfigValue("Preview", True) CONFIG.Config.FilePreview = CheckBox1.Checked
CONFIG.Save()
'SaveConfigValue("Preview", True)
End Sub End Sub
Private Function WORK_FILE() Private Function WORK_FILE()
Try Try
@ -3136,7 +3138,9 @@ Public Class frmIndex
Private Sub chkdelete_origin_CheckedChanged(sender As Object, e As EventArgs) Handles chkdelete_origin.CheckedChanged Private Sub chkdelete_origin_CheckedChanged(sender As Object, e As EventArgs) Handles chkdelete_origin.CheckedChanged
CURR_DELETE_ORIGIN = chkdelete_origin.Checked CURR_DELETE_ORIGIN = chkdelete_origin.Checked
SaveConfigValue("Delete_OriginFile", CURR_DELETE_ORIGIN) CONFIG.Config.DeleteOriginalFile = chkdelete_origin.Checked
CONFIG.Save()
'SaveConfigValue("Delete_OriginFile", CURR_DELETE_ORIGIN)
End Sub End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

View File

@ -7,7 +7,7 @@ Public NotInheritable Class frmSplash
'TODO: Dieses Formular kann einfach als Begrüßungsbildschirm für die Anwendung festgelegt werden, indem Sie zur Registerkarte "Anwendung" 'TODO: Dieses Formular kann einfach als Begrüßungsbildschirm für die Anwendung festgelegt werden, indem Sie zur Registerkarte "Anwendung"
' des Projekt-Designers wechseln (Menü "Projekt", Option "Eigenschaften"). ' des Projekt-Designers wechseln (Menü "Projekt", Option "Eigenschaften").
Private InitSteps As Integer = 4 Private InitSteps As Integer = 5
Private bw As New BackgroundWorker() Private bw As New BackgroundWorker()
Private Sub frmSplash_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Private Sub frmSplash_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
@ -57,15 +57,20 @@ Public NotInheritable Class frmSplash
Thread.Sleep(600) Thread.Sleep(600)
bw.ReportProgress(CalcProgress(2), "Initialize Database") bw.ReportProgress(CalcProgress(2), "Initialize Config")
Init.InitConfig()
Thread.Sleep(600)
bw.ReportProgress(CalcProgress(3), "Initialize Database")
If Init.InitDatabase() = True Then If Init.InitDatabase() = True Then
Thread.Sleep(600) Thread.Sleep(600)
bw.ReportProgress(CalcProgress(3), "Initialize UserConfiguration") bw.ReportProgress(CalcProgress(4), "Initialize UserConfiguration")
Init.InitUserLogin() Init.InitUserLogin()
Thread.Sleep(600) Thread.Sleep(600)
bw.ReportProgress(CalcProgress(4), "Initialize windream-Settings") bw.ReportProgress(CalcProgress(5), "Initialize windream-Settings")
Init.InitBasics() Init.InitBasics()
Thread.Sleep(500) Thread.Sleep(500)

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NLog" version="4.5.11" targetFramework="net461" />
</packages>