Solved

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

Posted on 2011-03-03
3
302 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

809 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