Question:
I have inserted Login() method in Viewer’s OnStartRunning event. However, when I click on Cancel button in the login window, the screen opens anyway. How can I fix this?
Solution:
Login() method returns either TRUE or FALSE, indicating whether the login was successfully performed. In this case, you can use VBScript’s “If” statement in the script to establish that, if it returns FALSE, Application.Exit() can be executed.
Example:
If Application.Login(true) = false then
Application.Exit()
End If
Obs.: Attached to this article is a sample application developed with E3 version 3.1 Build 270. In the application, use the following information for tests purposes: User: admin; Password: admin.