Console Application - avoid window closes

  • Thread starter Klaus Löffelmann
  • Start date
K

Klaus Löffelmann

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
 
R

Rick Mogstad

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.
 
K

Ken Tucker [MVP]

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
 
H

Herfried K. Wagner [MVP]

Klaus,

* "Klaus Löffelmann said:
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.
 
K

Klaus Löffelmann

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
 
H

Herfried K. Wagner [MVP]

* "Klaus Löffelmann said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top