Exit Code From VB application
-
I am writing a vb.net windows app that can be called from a scheduler or run as an application. How do I set a return or exit code for the application. i.e 0 if successfull or 1 if not. Thank you
It is possible do this by setting the App Startup to Main startup, instead of a form. You can do this in the Project Properties. But, you must add a class to the project and add a main function something like this:
Function Main() as Integer
The this main must start the first form in your program, if you have one. You can use the help in Visual Studio or on MSDN and search for "Structure of a Visual Basic Program" to find an example. RageInTheMachine9532
-
It is possible do this by setting the App Startup to Main startup, instead of a form. You can do this in the Project Properties. But, you must add a class to the project and add a main function something like this:
Function Main() as Integer
The this main must start the first form in your program, if you have one. You can use the help in Visual Studio or on MSDN and search for "Structure of a Visual Basic Program" to find an example. RageInTheMachine9532