fix file skip not working

This commit is contained in:
Jonathan Jenne
2019-02-12 17:46:52 +01:00
parent dd50938155
commit 4e756f06ed
2 changed files with 48 additions and 12 deletions

View File

@@ -33,6 +33,14 @@ Module ModuleMySettings
Return Path.Combine(Application.CommonAppDataPath(), CONFIG_FILE)
End Function
Public Function GetCurrentConfigPath() As String
If File.Exists(GetUserConfigPath()) Then
Return GetUserConfigPath()
Else
Return GetAllUsersConfigPath()
End If
End Function
Public Function Settings_Load()
Try
Dim oDatatable As DataTable
@@ -192,8 +200,10 @@ Module ModuleMySettings
''' </summary>
Public Function SaveMySettingsValue(name As String, value As String)
Try
Dim oConfigPath = GetUserConfigPath()
Dim oDatatable As DataTable = GetTablefromXML(oConfigPath)
Dim oUserConfigPath = GetUserConfigPath()
Dim oCurrentConfigPath = GetCurrentConfigPath()
Dim oDatatable As DataTable = GetTablefromXML(oCurrentConfigPath)
For Each Row As DataRow In oDatatable.Rows
If Row.Item("ConfigName") = name Then
@@ -201,7 +211,7 @@ Module ModuleMySettings
End If
Next
oDatatable.AcceptChanges()
oDatatable.WriteXml(oConfigPath)
oDatatable.WriteXml(oUserConfigPath)
Return True
Catch ex As Exception
MsgBox("Error in SaveConfigValue" & vbNewLine & ex.Message, MsgBoxStyle.Critical)