Solved

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

Posted on 2011-03-03
3
292 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:bobdylan75
  • 2
3 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 35024923
Here is how you can end a console application.

using System.Threading;

Process.GetCurrentProcess().Kill(); // Kills this program...
0
 
LVL 53

Assisted Solution

by:Dhaest
Dhaest earned 500 total points
ID: 35024927
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
 

Author Closing Comment

by:bobdylan75
ID: 35024972
thanky you very much!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now