TryCatch NavigationPane
This commit is contained in:
@@ -13,28 +13,33 @@
|
||||
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 ClassService.ConnectionTestResult
|
||||
Try
|
||||
Dim oIPAddress = txtIPAddress.Text
|
||||
Dim oPort = txtPort.Text
|
||||
Dim oEndpointURL = $"net.tcp://{oIPAddress}:{oPort}/DigitalData/Services/Main"
|
||||
Dim oResult As ClassService.ConnectionTestResult
|
||||
|
||||
My.SysConfig.ServiceIP = oIPAddress
|
||||
My.SysConfig.ServicePort = Integer.Parse(oPort)
|
||||
My.SysConfig.ServiceIP = oIPAddress
|
||||
My.SysConfig.ServicePort = Integer.Parse(oPort)
|
||||
|
||||
lblStatus.Text = "Verbindung wird hergestellt..."
|
||||
oResult = Await _Service.TestConnectionAsync()
|
||||
lblStatus.Text = "Verbindung wird hergestellt..."
|
||||
oResult = Await _Service.TestConnectionAsync()
|
||||
|
||||
If oResult = ClassService.ConnectionTestResult.Successful Then
|
||||
My.SystemConfigManager.Save()
|
||||
lblStatus.Text = "Verbindung hergestellt."
|
||||
Else
|
||||
Select Case oResult
|
||||
Case ClassService.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
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
|
||||
If oResult = ClassService.ConnectionTestResult.Successful Then
|
||||
My.SystemConfigManager.Save()
|
||||
lblStatus.Text = "Verbindung hergestellt."
|
||||
Else
|
||||
Select Case oResult
|
||||
Case ClassService.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
|
||||
|
||||
Reference in New Issue
Block a user