I'm writing an interface that extract information from TAPI packages and sends them through modbusTCP packages to a modbusclient.
Due to some library limitations, I had to write a code which exits application if there is no network connection even before loading any windows forms or GUI.
And since Application.exit()
raises formclosing event and do nothing else (as far as I know), I can not use this method (I tried and it failed to exit application).
How can exit application safely?