By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,633 Members | 1,930 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,633 IT Pros & Developers. It's quick & easy.

Console Application - avoid window closes

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
* "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 discussion thread is closed

Replies have been disabled for this discussion.