Guest User

Untitled

a guest
May 25th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. `public delegate void OnLoginFailedEvent(
  2. FailReason Reason
  3.  
  4. Public Event OnLoginFailed()
  5. Public Delegate Sub OEC_OnLoginFailedEvent(ByVal FailReason As OEC.Data.FailReason)
  6.  
  7.  
  8.  
  9. Private Sub btnConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConnect.Click
  10. If txbUsername.Text = Nothing Or txbPassword.Text = Nothing Or txbServer.Text = Nothing Then
  11. 'Connect to the server, if the details are wrong then show the error message in the label.
  12. MsgBox("One of your required fields are empty, Please try again.", MsgBoxStyle.Critical, "Application Error")
  13. Else
  14. 'Catch Exception
  15. '
  16. Try
  17. OECClient1.Disconnect()
  18. OECClient1.Connect(txbServer.Text, txbPort.Text, txbUsername.Text, txbPassword.Text, False)
  19.  
  20.  
  21. Catch ex As Exception
  22. MessageBox.Show(ex.Message)
  23. End Try
  24. End If
  25. End Sub
  26.  
  27. Public Sub OnLoginFailure() Handles OECClient1.OnLoginFailedEvent
  28. 'Do something upon failure here...
  29. End Sub
Add Comment
Please, Sign In to add comment