Closing Application

Hello Everyone and thanks for your help in advance. I have written a Windows application that is triggered by Windows Scheduler each evening. Basically, the program starts a thread, parses some text files, and then loads data to a SQL Server database. However, since Windows scheduler needs to run it each evening, I need to the application to close at the end of the thread. However, I am not exactly sure how to accomplish this and determine if everything has completed. Any help on this topic would be greatly appreciated. Thanks.



Answer this question

Closing Application

  • Tom.

    I understand that part of it.  But I am concerned about the timing of it.  Does it simply come at the end of the thread and assumes that everything has processed before reaching the end   Or is that not an issue since the processes are already executed

    Thanks again.

  • ChaituKris

    just call

    Application.Exit()
     

  • Will Wilson

    define a integer variable =0 as a flag, once the thread start, set the flag plus 1, when the thread end, minus 1. before closing the application, check the flag, if 0,  no thread is running.

  • Jamie El Fattal

    Use the flag idea above and me.close() in vb.net

  • Closing Application