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

Console Application - avoid window closes

Hi,

it may be a stupid question and maybe I'm not seeing the wood for the trees,
but how do I let the console window remaining open after the app terminates?

(Console.Readline as last code line won't work in my case, since I'm testing
a class' finalize-method).

Thanks

Klaus
Nov 20 '05 #1
5 6743
The easiest way is to have the window open before you run it. Then run it from the command line,
it should stay open when the app terminates. There is probably another way to do it though.
"Klaus Löffelmann" <fo***********@loeffelmann.de> wrote in message
news:OV**************@tk2msftngp13.phx.gbl...
Hi,

it may be a stupid question and maybe I'm not seeing the wood for the trees,
but how do I let the console window remaining open after the app terminates?

(Console.Readline as last code line won't work in my case, since I'm testing
a class' finalize-method).

Thanks

Klaus

Nov 20 '05 #2
Hi,

Start the app with ctrl-F5 or add Console.Readline() at the end.

Module Module1

Sub Main()

Dim x As Integer

For x = 0 To 9

Console.WriteLine(x.ToString)

Next

Console.Write("Press enter to continue")

Console.ReadLine()

End Sub

End Module

Ken
-----------------
"Klaus Löffelmann" <fo***********@loeffelmann.de> wrote in message
news:OV**************@tk2msftngp13.phx.gbl...
Hi,

it may be a stupid question and maybe I'm not seeing the wood for the trees, but how do I let the console window remaining open after the app terminates?
(Console.Readline as last code line won't work in my case, since I'm testing a class' finalize-method).

Thanks

Klaus

Nov 20 '05 #3
Klaus,

* "Klaus Löffelmann" <fo***********@loeffelmann.de> scripsit:
it may be a stupid question and maybe I'm not seeing the wood for the trees,
but how do I let the console window remaining open after the app terminates?

(Console.Readline as last code line won't work in my case, since I'm testing
a class' finalize-method).


I replied in the German language VB.NET group.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
Sorry, for the "kind of" cross posting, Herfried,
but I wrote to the German newsgroup not noticing it was already something
like 2am. So I thought taking advantage of the time difference and therefore
posting it here again could help me right away...

:-)

Klaus


"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb im Newsbeitrag
news:bq*************@ID-208219.news.uni-berlin.de...
Klaus,

* "Klaus Löffelmann" <fo***********@loeffelmann.de> scripsit:
it may be a stupid question and maybe I'm not seeing the wood for the trees, but how do I let the console window remaining open after the app terminates?
(Console.Readline as last code line won't work in my case, since I'm testing a class' finalize-method).


I replied in the German language VB.NET group.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #5
* "Klaus Löffelmann" <fo***********@loeffelmann.de> scripsit:
Sorry, for the "kind of" cross posting, Herfried,
but I wrote to the German newsgroup not noticing it was already something
like 2am. So I thought taking advantage of the time difference and therefore
posting it here again could help me right away...


You don't need to apologize.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6

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

Similar topics

5
by: James | last post by:
I'm totally new to C++ and when I try to execute the simple program I have written, it closes the console application as soon as it has finished excuting. This obviously means I cannot see the...
1
by: Reinier Beeckman | last post by:
I have made a simple console application which run through the Windows scheduled task. When the program is starten i get the console in the screen. Is it also possible to configure it that the...
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...
2
by: Jim Heavey | last post by:
When I run a console application by bringing up a dos window and then running the exe, I noticed that when I close the dos window, this kills my application. My question is, Is there some way that...
1
by: Terry Olsen | last post by:
I would like to hide a console window on startup so that the user can't close it. is this possible? If so, how would I also show it when I want to view it? *** Sent via Developersdex...
6
by: Giojo | last post by:
Hello guys! I can't resolve this problem.. I want my programm in c# working with only console if there are some parameters, but if someone make double-click on the exe I want to start the graphic...
7
by: Abelard | last post by:
How do I programmatically minimize the console window in a VB .NET console application?
3
by: TC | last post by:
I'm trying to debug a console application, but I can't see the console output. I've seen many references which say that console output is supposed to appear on the Output window when the...
4
by: collinsp | last post by:
Can any one help me with the code below. I am just learning C and any help would be appreciated. When I run the program the console opens, the printf in the function getData prints, I enter the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.