473,395 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Ending the appliation reliably

Hi all,

Is it safe to use application.exit or application.exitthread to end a
program in .NET?

If we didn't use the forms designer then there isn't any generated code to
dispose of controls upon termination, would the above clear any resources
up?

Also, what if we have a multi-thread app?

Perhaps it's better to use the API? Maybe TerminateProcess???

Adam
Apr 11 '06 #1
1 880
Adam,

The best Net programs are withouth any API. When you had looked at the
beginning in this newsgroup, it were all answers with API's. Given by VB6
guys/girls. Now you don't see them almost not anymore (they can be needed in
some cases)

In fact you don't have to set anything to close your application, the user
does it with pushing the cross. While mostly the me.close from the mainform
does it if you want to forsce this.

The settup setting in your project properties tells how you start your
project. This setting is a little bit different for the version 2002/2003
and 2005. Easier but more confusing in the first one.

In a sub main class, the logic goes normally just to an end.

One of the main points of managed code is to release all used managed
recourses.

I hope this helps,

Cor
"Adam Honek" <Ad*******@Webmaster2001.freeserve.co.uk> schreef in bericht
news:OQ**************@TK2MSFTNGP03.phx.gbl...
Hi all,

Is it safe to use application.exit or application.exitthread to end a
program in .NET?

If we didn't use the forms designer then there isn't any generated code to
dispose of controls upon termination, would the above clear any resources
up?

Also, what if we have a multi-thread app?

Perhaps it's better to use the API? Maybe TerminateProcess???

Adam

Apr 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Robert Hanson | last post by:
Hi All, I noticed that when I place the ending bracket on a function, the enclosed statements will bold for a short period of time. Is there a way to get that to occur again after you have...
4
by: Greg Smith | last post by:
I am working on my first web app. What is the proper way to end the application and close the aspx page? Any help is greatly appreciated.
4
by: BentleyInc | last post by:
I'm trying to find a way to add a whildcard application mapping to aspnet_isapi.dll in IIS programmatically.... been looking into IIS administrator reference but didn't find the right function to...
3
by: Ben R. | last post by:
In an article I was reading (http://www.ftponline.com/vsm/2005_06/magazine/columns/desktopdeveloper/), I read the following: "The ending condition of a VB.NET for loop is evaluated only once,...
27
by: cj | last post by:
I run this program and to exit click the X in the upper right corner. But apparently it isn't really ending the program. If I return to VB and make changes then try to rebuild the app it says the...
4
by: csgraham74 | last post by:
Hi Guys, I was wondering if anyone could help me find a function to get a week ending function?? i.e. week ending on sunday Therefore if a i was to input todays date in my function it would...
2
by: barry.edmund.wright | last post by:
Hi All, I want to build a Find Statement on the fly. The code below starting with 'This Code Works! is fine but as I said I want to build the Me!cboSelect1 & "=" & rs(Me!cboSelect1) portion of...
34
by: Umesh | last post by:
I want to extract a string abc*xyz from a text file. * indicates arbitrary no. of characters. I'm only able to do it when the string has definite no. of characters or the string length is...
0
by: jmarcrum | last post by:
Hi all, I have an excel spreadsheet that in column A, has a formula under the first row in A2 that automatically calculates the Week-ending date when someone starts typing something in cells B2,...
3
by: stockton | last post by:
I have written the following Stored Procedure in an attempt to update two tables in the same database reliably but unfortunately it is not too successful. I ocassionaly end up with only the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.