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,4 +1,4 @@
<?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">
@ -9,12 +9,10 @@
</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>

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