C #: Non-Winforms way to exit the application?

I know about Application.Exit (), but what if I am not in a Windows Forms application, but in a simple class library, how do I signal the application to exit?

+4
source share
2 answers

Environment.Exit () - but why do you want to do this from a method in a class library?

+7
source

P / Invoke ExitProcess , possibly. Or, if you're really in a hurry, TerminateProcess .

+3
source

Source: https://habr.com/ru/post/1277512/


All Articles