How to kill Thread on exit?

后端 未结 2 2053
Happy的楠姐
Happy的楠姐 2020-12-14 07:47

A button on the parent form is used to start the thread. If the parent form is closed in the development environment the thread keeps running in the background preventing ed

2条回答
  •  感动是毒
    2020-12-14 08:17

    Environment.Exit(0) terminates this process and gives the underlying operating system the specified exit code. It is more generally used in console applications.

    Environment.Exit(0);
    

提交回复
热议问题