0

I am making a WPF Application with .NET Framework 2.0 and currently I am having trouble stopping the program, I try to do it like this

System.Threading.Thread.CurrentThread.Interrupt();
Application.ExitThread();
Application.Exit();

but after this code executes, I check the task manager, and there I see that my program is still running and do not have intentions of stopping any time soon...

How do I stop it completely?

Sartheris Stormhammer
  • 2,534
  • 8
  • 37
  • 81

3 Answers3

2

try using :

Environment.Exit(0)

It will end all processes from all threads.

Ziv Weissman
  • 4,400
  • 3
  • 28
  • 61
2

Try one of these:

// Graceful

Application.Current.Shutdown();

// Harsh out

Environment.Exit(0);

Norman Skinner
  • 6,729
  • 1
  • 19
  • 22
-1

How about Response.End(); Not sure if this is what you are looking for

bob_tiamsic
  • 33
  • 1
  • 9