473,385 Members | 2,243 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,385 software developers and data experts.

Console application stopping at end

I noticed that when I run my program from "Start without Debugging", it will
stop and wait for a key to struck.

If I run my progoram from must "Start" it will not stop and will close the
console window when finished. The same thing if I just run the program from
a command line.

Why is that?

Is there something in the Properties that causes it to work this way?

I am going to run this from the Schedular and don't want it to stop at all.

Thanks,

Tom
May 23 '07 #1
1 2480
I am somewhat new but... It is my understanding that a console application
will close and take the cosole window with it once it has finished with its
execution routine(s).

One thing I do in order to get around this is and keep the console window
up, requireing user input is to use the following line of code at the very
end of the code block:

Console.Read()

All this line will do is prevent the console window from automatically
closing, it will not cause the code to loop or anything else.

I don't know what you have your code doing...

But drop this in as the last line and see if it provides the result your
looking for.

Thanks-

Tony Wissler

"tshad" <t@home.comwrote in message
news:%2***************@TK2MSFTNGP05.phx.gbl...
>I noticed that when I run my program from "Start without Debugging", it
will stop and wait for a key to struck.

If I run my progoram from must "Start" it will not stop and will close
the console window when finished. The same thing if I just run the
program from a command line.

Why is that?

Is there something in the Properties that causes it to work this way?

I am going to run this from the Schedular and don't want it to stop at
all.

Thanks,

Tom

May 23 '07 #2

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

Similar topics

1
by: Oz | last post by:
This is long. Bear with me, as I will really go through all the convoluted stuff that shows there is a problem with streams (at least when used to redirect stdout). The basic idea is that my...
5
by: WildHare | last post by:
I have a console application that I want to continue to run until I press a key. How can I get a keypress without stopping execution? Thanks.
11
by: Peter Steele | last post by:
I have a Windows application written in C# that I want to return a non-zero exit code when it it run. The problem is that as a Windows application, there doesn't seem to be a way to control this....
5
by: Barry Mossman | last post by:
Hi, can I detect whether my class is running within the context of a Console application, vs say a WinForm's application ? also does anyone know whether the compiler or runtime is smart enough...
0
by: Joe Abou Jaoude | last post by:
hi, I compiled a console app to be debuggable and i verified to have the .pdb file along with the .exe file. in the main function I wrote this line in the begining Console.ReadLine () so that...
5
by: Markus S. | last post by:
Hello, I have a problem with a DOS EXE that is called by a .Net Winforms application. I need to redirect the console output into a textbox, but this should happen in real time, so when new...
2
by: shiry | last post by:
Hi, I need to do some important cleanup before my console application exists. I got some ideas from the groups and I used the console ctrl event. This is working well and it fires for all cases,...
10
by: shiry | last post by:
Hi, I need to do some important cleanup before my console application exists. I used the console ctrl event. This is working well and it fires for all cases, including the CTRL_CLOSE_EVENT (if I...
12
by: Dilip | last post by:
Hi All I have a server based C# console application. This application must hide its console window when its launched out on the field. So I dutifully P/Invoke'd FindWindow/ShowWindow...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.