Improve Config

This commit is contained in:
Jonathan Jenne
2019-02-14 15:15:42 +01:00
parent 914ba9dc90
commit 191b3010bb
6 changed files with 68 additions and 33 deletions

View File

@@ -6,6 +6,11 @@ Public Class frmConfigService
Private Sub frmServiceConfig_Load(sender As Object, e As EventArgs) Handles Me.Load
_Init = New ClassInit()
If My.ConfigManager.Config.ServiceConnection <> String.Empty Then
txtIPAddress.Text = My.ConfigManager.Config.ServiceIP
txtPort.Text = My.ConfigManager.Config.ServicePort
End If
txtIPAddress.Focus()
End Sub
@@ -15,12 +20,14 @@ Public Class frmConfigService
Dim oEndpointURL = $"net.tcp://{oIPAddress}:{oPort}/DigitalData/Services/Main"
Dim oResult As ConnectionTestResult
My.Config.ServiceIP = oIPAddress
My.Config.ServicePort = Integer.Parse(oPort)
lblStatus.Text = "Verbindung wird hergestellt..."
oResult = Await _Init.TestConnectionAsync(oEndpointURL)
oResult = Await _Init.TestConnectionAsync(My.ConfigManager.Config.ServiceConnection)
If oResult = ConnectionTestResult.Successful Then
' Save Endpoint URL
My.ConfigManager.Config.ServiceConnection = oEndpointURL
My.ConfigManager.Save()
'My.Settings.ICMServiceAddress = oEndpointURL
lblStatus.Text = "Verbindung hergestellt."