Improve Config
This commit is contained in:
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user