diff --git a/app/DD_PM_WINDREAM/ClassConfig.vb b/app/DD_PM_WINDREAM/ClassConfig.vb index dc09ab3..b767df3 100644 --- a/app/DD_PM_WINDREAM/ClassConfig.vb +++ b/app/DD_PM_WINDREAM/ClassConfig.vb @@ -6,6 +6,7 @@ Public Class ClassConfig Public Property ConnectionString As String = "" Public Property ConnectionStringTest As String = "" + Public Property TestMode As Boolean = False ' PDF Viewer Settings Public Property UniversalViewerPath As String = "" diff --git a/app/DD_PM_WINDREAM/ClassInit.vb b/app/DD_PM_WINDREAM/ClassInit.vb index 53b5887..f3ff9de 100644 --- a/app/DD_PM_WINDREAM/ClassInit.vb +++ b/app/DD_PM_WINDREAM/ClassInit.vb @@ -24,7 +24,7 @@ Public Class ClassInit CONFIG = New ConfigManager(Of ClassConfig)(LOGCONFIG, Application.UserAppDataPath, Application.CommonAppDataPath) LOGGER.Info("Config loaded") - If CONFIG.Config.ConnectionStringTest <> String.Empty Then + If CONFIG.Config.ConnectionStringTest <> String.Empty And CONFIG.Config.TestMode = True Then LOGGER.Debug("Test Connection String loaded") CONNECTION_STRING = DecryptConnectionString(CONFIG.Config.ConnectionStringTest) Else @@ -46,6 +46,7 @@ Public Class ClassInit LOG_ERRORS_ONLY = CONFIG.Config.LogErrorsOnly LOGCONFIG.Debug = Not LOG_ERRORS_ONLY + TEST_MODE = CONFIG.Config.TestMode 'Settings_Load() End Sub diff --git a/app/DD_PM_WINDREAM/ModuleMySettings.vb b/app/DD_PM_WINDREAM/ModuleMySettings.vb index 912141c..fdd1270 100644 --- a/app/DD_PM_WINDREAM/ModuleMySettings.vb +++ b/app/DD_PM_WINDREAM/ModuleMySettings.vb @@ -1,6 +1,7 @@ Module ModuleMySettings ' Connection String Public CONNECTION_STRING As String = "" + Public TEST_MODE As String = False ' Debug Settings Public LOG_ERRORS_ONLY As Boolean = True diff --git a/app/DD_PM_WINDREAM/frmKonfig.Designer.vb b/app/DD_PM_WINDREAM/frmKonfig.Designer.vb index eabf5ee..cf35e60 100644 --- a/app/DD_PM_WINDREAM/frmKonfig.Designer.vb +++ b/app/DD_PM_WINDREAM/frmKonfig.Designer.vb @@ -22,7 +22,6 @@ Partial Class frmKonfig 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. _ Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmKonfig)) Me.btnuniversalview = New System.Windows.Forms.Button() Me.Label13 = New System.Windows.Forms.Label() @@ -69,9 +68,11 @@ Partial Class frmKonfig Me.Button1 = New System.Windows.Forms.Button() Me.btnLogMail = New System.Windows.Forms.Button() Me.DD_DMSLiteDataSet = New DD_PM_WINDREAM.DD_DMSLiteDataSet() - Me.TBPM_KONFIGURATIONBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.TBPM_KONFIGURATIONBindingSource = New System.Windows.Forms.BindingSource() Me.TBPM_KONFIGURATIONTableAdapter = New DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBPM_KONFIGURATIONTableAdapter() Me.TableAdapterManager = New DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TableAdapterManager() + Me.RadioDefaultConnection = New System.Windows.Forms.RadioButton() + Me.RadioAlternativeConnection = New System.Windows.Forms.RadioButton() Me.TabControl1.SuspendLayout() Me.TabPage1.SuspendLayout() Me.GroupBox1.SuspendLayout() @@ -221,6 +222,8 @@ Partial Class frmKonfig ' 'TabPage2 ' + Me.TabPage2.Controls.Add(Me.RadioAlternativeConnection) + Me.TabPage2.Controls.Add(Me.RadioDefaultConnection) Me.TabPage2.Controls.Add(Me.chkbxUserAut) Me.TabPage2.Controls.Add(Me.Label5) Me.TabPage2.Controls.Add(Me.cmbDatenbank) @@ -413,6 +416,20 @@ Partial Class frmKonfig Me.TableAdapterManager.TBPM_TYPETableAdapter = Nothing Me.TableAdapterManager.UpdateOrder = DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete ' + 'RadioDefaultConnection + ' + resources.ApplyResources(Me.RadioDefaultConnection, "RadioDefaultConnection") + Me.RadioDefaultConnection.Checked = True + Me.RadioDefaultConnection.Name = "RadioDefaultConnection" + Me.RadioDefaultConnection.TabStop = True + Me.RadioDefaultConnection.UseVisualStyleBackColor = True + ' + 'RadioAlternativeConnection + ' + resources.ApplyResources(Me.RadioAlternativeConnection, "RadioAlternativeConnection") + Me.RadioAlternativeConnection.Name = "RadioAlternativeConnection" + Me.RadioAlternativeConnection.UseVisualStyleBackColor = True + ' 'frmKonfig ' resources.ApplyResources(Me, "$this") @@ -482,4 +499,6 @@ Partial Class frmKonfig Friend WithEvents Label7 As System.Windows.Forms.Label Friend WithEvents txtIntervall As System.Windows.Forms.TextBox Friend WithEvents Label6 As System.Windows.Forms.Label + Friend WithEvents RadioAlternativeConnection As RadioButton + Friend WithEvents RadioDefaultConnection As RadioButton End Class diff --git a/app/DD_PM_WINDREAM/frmKonfig.resx b/app/DD_PM_WINDREAM/frmKonfig.resx index 5f71906..632bdf5 100644 --- a/app/DD_PM_WINDREAM/frmKonfig.resx +++ b/app/DD_PM_WINDREAM/frmKonfig.resx @@ -278,6 +278,700 @@ 5 + + GroupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage1 + + + 0 + + + txtUniversalViewer + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage1 + + + 2 + + + Verdana, 9.75pt + + + 4, 26 + + + + 3, 3, 3, 3 + + + 832, 318 + + + 0 + + + Darstellung Dateien: + + + TabPage1 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabControl1 + + + 0 + + + RadioAlternativeConnection + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage2 + + + 0 + + + RadioDefaultConnection + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage2 + + + 1 + + + chkbxUserAut + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage2 + + + 2 + + + Label5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage2 + + + 3 + + + cmbDatenbank + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage2 + + + 4 + + + Label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage2 + + + 5 + + + Label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage2 + + + 6 + + + Label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage2 + + + 7 + + + Label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage2 + + + 8 + + + txtUser + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage2 + + + 9 + + + txtPasswort + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage2 + + + 10 + + + BtnConnect + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage2 + + + 11 + + + txtActualConnection + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage2 + + + 12 + + + txtServer + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage2 + + + 13 + + + 4, 26 + + + 3, 3, 3, 3 + + + 832, 318 + + + 1 + + + Datenbankverbindung: + + + TabPage2 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabControl1 + + + 1 + + + True + + + 52, 165 + + + 55, 17 + + + 45 + + + Minuten + + + Label7 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage3 + + + 0 + + + 8, 162 + + + 38, 25 + + + 44 + + + Center + + + txtIntervall + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage3 + + + 1 + + + True + + + 5, 142 + + + 159, 17 + + + 43 + + + Intervall Popup-Reminder: + + + Label6 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage3 + + + 2 + + + MiddleLeft + + + 8, 99 + + + 219, 28 + + + 42 + + + Öffne Log-Verzeichnis + + + btnopenlog + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage3 + + + 3 + + + True + + + 506, 28 + + + 117, 21 + + + 41 + + + Log Errors only + + + chkLogErrorsOnly + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage3 + + + 4 + + + 8, 64 + + + 219, 29 + + + 40 + + + Open Appdata-Folder + + + Button3 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage3 + + + 5 + + + True + + + 233, 29 + + + 166, 17 + + + 39 + + + Support-Portal Digital Data + + + LinkLabel1 + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage3 + + + 6 + + + 506, 105 + + + 219, 28 + + + 38 + + + List all processes + + + Button2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage3 + + + 7 + + + 506, 71 + + + 219, 29 + + + 37 + + + Get Culture Info + + + Button1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage3 + + + 8 + + + MiddleLeft + + + 8, 17 + + + 219, 41 + + + 0 + + + Log/Support Mail erzeugen + + + MiddleRight + + + btnLogMail + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage3 + + + 9 + + + 4, 26 + + + 3, 3, 3, 3 + + + 832, 318 + + + 2 + + + Weiteres + + + TabPage3 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabControl1 + + + 2 + + + Fill + + + 0, 0 + + + 840, 348 + + + 21 + + + TabControl1 + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + rbPDF_internal + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GroupBox1 + + + 0 + + + rbSystem + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GroupBox1 + + + 1 + + + btnno_pdf_viewer + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GroupBox1 + + + 2 + + + rbSumatra + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GroupBox1 + + + 3 + + + rbPDFX_Change + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GroupBox1 + + + 4 + + + btnSumatra + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GroupBox1 + + + 6 + + + txtpdfxchange + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GroupBox1 + + + 7 + + + txtSumatra + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GroupBox1 + + + 8 + + + lblSumatra + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GroupBox1 + + + 10 + + + 10, 77 + + + 659, 234 + + + 25 + + + PDF-Viewer (optional) + + + GroupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage1 + + + 0 + True @@ -515,30 +1209,6 @@ 10 - - 10, 77 - - - 659, 234 - - - 25 - - - PDF-Viewer (optional) - - - GroupBox1 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabPage1 - - - 0 - 10, 22 @@ -560,42 +1230,11 @@ 2 - - Verdana, 9.75pt - - - 4, 26 - - - - 3, 3, 3, 3 - - - 832, 318 - - - 0 - - - Darstellung Dateien: - - - TabPage1 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabControl1 - - - 0 - True - 510, 32 + 510, 57 182, 21 @@ -616,13 +1255,13 @@ TabPage2 - 0 + 2 True - 5, 111 + 5, 136 164, 17 @@ -643,10 +1282,10 @@ TabPage2 - 1 + 3 - 8, 78 + 8, 103 252, 25 @@ -664,13 +1303,13 @@ TabPage2 - 2 + 4 True - 5, 58 + 5, 83 73, 17 @@ -691,13 +1330,13 @@ TabPage2 - 3 + 5 True - 5, 10 + 5, 35 88, 17 @@ -718,13 +1357,13 @@ TabPage2 - 4 + 6 True - 299, 10 + 299, 35 93, 17 @@ -745,13 +1384,13 @@ TabPage2 - 5 + 7 True - 423, 10 + 423, 35 63, 17 @@ -772,10 +1411,10 @@ TabPage2 - 6 + 8 - 302, 30 + 302, 55 118, 25 @@ -793,10 +1432,10 @@ TabPage2 - 7 + 9 - 426, 30 + 426, 55 64, 25 @@ -814,13 +1453,13 @@ TabPage2 - 8 + 10 MiddleLeft - 302, 78 + 302, 103 253, 25 @@ -844,13 +1483,13 @@ TabPage2 - 9 + 11 Top, Left, Right - 8, 131 + 8, 156 744, 25 @@ -868,10 +1507,10 @@ TabPage2 - 10 + 12 - 8, 30 + 8, 55 288, 25 @@ -889,346 +1528,7 @@ TabPage2 - 11 - - - 4, 26 - - - 3, 3, 3, 3 - - - 832, 318 - - - 1 - - - Datenbankverbindung: - - - TabPage2 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabControl1 - - - 1 - - - True - - - 52, 165 - - - 55, 17 - - - 45 - - - Minuten - - - Label7 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabPage3 - - - 0 - - - 8, 162 - - - 38, 25 - - - 44 - - - Center - - - txtIntervall - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabPage3 - - - 1 - - - True - - - 5, 142 - - - 159, 17 - - - 43 - - - Intervall Popup-Reminder: - - - Label6 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabPage3 - - - 2 - - - MiddleLeft - - - 8, 99 - - - 219, 28 - - - 42 - - - Öffne Log-Verzeichnis - - - btnopenlog - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabPage3 - - - 3 - - - True - - - 506, 28 - - - 117, 21 - - - 41 - - - Log Errors only - - - chkLogErrorsOnly - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabPage3 - - - 4 - - - 8, 64 - - - 219, 29 - - - 40 - - - Open Appdata-Folder - - - Button3 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabPage3 - - - 5 - - - True - - - 233, 29 - - - 166, 17 - - - 39 - - - Support-Portal Digital Data - - - LinkLabel1 - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabPage3 - - - 6 - - - 506, 99 - - - 219, 28 - - - 38 - - - List all processes - - - Button2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabPage3 - - - 7 - - - 506, 64 - - - 219, 29 - - - 37 - - - Get Culture Info - - - Button1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabPage3 - - - 8 - - - MiddleLeft - - - 8, 17 - - - 219, 41 - - - 0 - - - Log/Support Mail erzeugen - - - MiddleRight - - - btnLogMail - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabPage3 - - - 9 - - - 4, 26 - - - 3, 3, 3, 3 - - - 832, 318 - - - 2 - - - Weiteres - - - TabPage3 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabControl1 - - - 2 - - - Fill - - - 0, 0 - - - 840, 348 - - - 21 - - - TabControl1 - - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 + 13 159, 17 @@ -1242,6 +1542,63 @@ 841, 17 + + True + + + 8, 6 + + + 148, 21 + + + 36 + + + Normale Verbindung + + + RadioDefaultConnection + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage2 + + + 1 + + + True + + + NoControl + + + 173, 6 + + + 158, 21 + + + 36 + + + Alternative Verbindung + + + RadioAlternativeConnection + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabPage2 + + + 0 + True diff --git a/app/DD_PM_WINDREAM/frmKonfig.vb b/app/DD_PM_WINDREAM/frmKonfig.vb index 880201a..dc9670c 100644 --- a/app/DD_PM_WINDREAM/frmKonfig.vb +++ b/app/DD_PM_WINDREAM/frmKonfig.vb @@ -150,12 +150,17 @@ Public Class frmKonfig oEncryptedConnectionString = oPlainConnectionString End If - 'SaveMySettingsValue("MyConnectionString", con) - 'My.Settings.Save() - - CONNECTION_STRING = oPlainConnectionString - CONFIG.Config.ConnectionString = oEncryptedConnectionString - CONFIG.Save() + If RadioDefaultConnection.Checked Then + LOGGER.Debug("ConnectionString saved") + CONNECTION_STRING = oPlainConnectionString + CONFIG.Config.ConnectionString = oEncryptedConnectionString + CONFIG.Save(ForceAll:=True) + Else + LOGGER.Debug("ConnectionStringTest saved") + CONNECTION_STRING = oPlainConnectionString + CONFIG.Config.ConnectionStringTest = oEncryptedConnectionString + CONFIG.Save(ForceAll:=True) + End If Load_ConString(CONNECTION_STRING) Me.TBPM_KONFIGURATIONTableAdapter.Connection.ConnectionString = CONNECTION_STRING @@ -320,15 +325,20 @@ Public Class frmKonfig End If End Sub Sub Load_ConString(constr As String) - If constr <> "" And constr.Contains("Password") Then - Dim csb As New SqlClient.SqlConnectionStringBuilder - csb.ConnectionString = CONNECTION_STRING - constr = constr.Replace(csb.Password, "XXXXX") - End If - - Me.txtActualConnection.Text = constr + txtActualConnection.Text = MaskConnectionStringPassword(constr) End Sub + Private Function MaskConnectionStringPassword(ConnectionString As String) As String + If ConnectionString.Contains("Password=") Then + Dim oBuilder As New SqlClient.SqlConnectionStringBuilder() With { + .ConnectionString = ConnectionString + } + Return ConnectionString.Replace(oBuilder.Password, "XXXXXX") + End If + + Return ConnectionString + End Function + Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked ' Specify that the link was visited. Me.LinkLabel1.LinkVisited = True @@ -357,4 +367,14 @@ Public Class frmKonfig CONFIG.Save() 'SaveMySettingsValue("LogErrorsOnly", chkLogErrorsOnly.Checked) End Sub + + Private Sub RadioDefaultConnection_CheckedChanged(sender As Object, e As EventArgs) Handles RadioDefaultConnection.CheckedChanged + txtActualConnection.Text = MaskConnectionStringPassword(CONFIG.Config.ConnectionString) + + + End Sub + + Private Sub RadioAlternativeConnection_CheckedChanged(sender As Object, e As EventArgs) Handles RadioAlternativeConnection.CheckedChanged + txtActualConnection.Text = MaskConnectionStringPassword(CONFIG.Config.ConnectionStringTest) + End Sub End Class \ No newline at end of file