Is There an "istruction code" in vb.net to close a console application? (VS2005)

HI,
Is There an "istruction code" in vb.net to close a console application? (VS2005)
because I have not the possibility to terminate the "main function",
because of the thread of my functions

I'm trying with Application.Exit, but I don't know what
references have to add in order to use this object.
bobdylan75Asked:
Who is Participating?
 
DhaestConnect With a Mentor Commented:
Here is how you can end a console application.

using System.Threading;

Process.GetCurrentProcess().Kill(); // Kills this program...
0
 
DhaestConnect With a Mentor Commented:
Also
System.Environment.Exit(exitCode) - Terminates this process and gives the underlying operating system the specified exit code.  This call requires that you have SecurityPermissionFlag.UnmanagedCode permissions. If you do not, a SecurityException error occurs.  This is the call to use if you are running a console application.

0
 
bobdylan75Author Commented:
thanky you very much!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.