40 lines
1.5 KiB
VB.net
40 lines
1.5 KiB
VB.net
Imports EDMI_ClientSuite.ClassInit
|
|
|
|
Public Class frmConfigService
|
|
Private _Init As ClassInit
|
|
|
|
Private Sub frmServiceConfig_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
_Init = New ClassInit()
|
|
|
|
txtIPAddress.Focus()
|
|
End Sub
|
|
|
|
Private Async Sub btnTest_Click(sender As Object, e As EventArgs) Handles btnTest.Click
|
|
Dim oIPAddress = txtIPAddress.Text
|
|
Dim oPort = txtPort.Text
|
|
Dim oEndpointURL = $"net.tcp://{oIPAddress}:{oPort}/DigitalData/Services/Main"
|
|
Dim oResult As ConnectionTestResult
|
|
|
|
lblStatus.Text = "Verbindung wird hergestellt..."
|
|
oResult = Await _Init.TestConnectionAsync(oEndpointURL)
|
|
|
|
If oResult = ConnectionTestResult.Successful Then
|
|
' Save Endpoint URL
|
|
My.ConfigManager.Config.ServiceConnection = oEndpointURL
|
|
My.ConfigManager.Save()
|
|
'My.Settings.ICMServiceAddress = oEndpointURL
|
|
lblStatus.Text = "Verbindung hergestellt."
|
|
Else
|
|
Select Case oResult
|
|
Case ConnectionTestResult.NotFound
|
|
lblStatus.Text = "Dienst konnte nicht gefunden werden. Bitte überprüfen sie Addresse und Port."
|
|
Case Else
|
|
lblStatus.Text = "Unbekannter Fehler."
|
|
End Select
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click
|
|
DialogResult = DialogResult.OK
|
|
End Sub
|
|
End Class |