473,327 Members | 1,997 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,327 software developers and data experts.

How to keep Console window open

Hi All,

When I create a Console app in VS.net and run it, the Console window opens
briefly and closes. If I was running a .bat command file, I'd append a
pause stmt at the end. What can I do in VS? I'm a newbie and keeping that
window open would be helpful for studying.

Thanks in advance,
Richard
Aug 30 '05 #1
5 34218
Run the application from the command prompt or use the
System.Diagnostics namespace to access Debug.WriteLine and output to
the output window in Visual Studio instead.

Aug 30 '05 #2
Add Console.ReadLine() at the end of Main. That will keep the console open
until you press the "any" key.

--
Peter Bernhardt
SharpSense Software LLC
pe***@SharpBASSense.netURA
"Richard Lionheart" <No***@Nowhere.net> wrote in message
news:en**************@TK2MSFTNGP10.phx.gbl...
Hi All,

When I create a Console app in VS.net and run it, the Console window
opens briefly and closes. If I was running a .bat command file, I'd
append a pause stmt at the end. What can I do in VS? I'm a newbie and
keeping that window open would be helpful for studying.

Thanks in advance,
Richard

Aug 30 '05 #3
Hi Kurt,
Run the application from the command prompt or use the
System.Diagnostics namespace to access Debug.WriteLine and output to
the output window in Visual Studio instead.


Makes sense. But my ideal would be that I could write the app to test which
environment it was running in and then write to the appropriate output
statement, which I'd then encapsulate into MyOutput(string).

Thanks for your knowledgeable and fast response.
Richard
Aug 30 '05 #4
That should be, until you press "Enter".

--
Peter Bernhardt
SharpSense Software LLC
pe***@SharpBASSense.netURA
"Peter Bernhardt" <pe***@spammenot.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Add Console.ReadLine() at the end of Main. That will keep the console open
until you press the "any" key.

--
Peter Bernhardt
SharpSense Software LLC
pe***@SharpBASSense.netURA
"Richard Lionheart" <No***@Nowhere.net> wrote in message
news:en**************@TK2MSFTNGP10.phx.gbl...
Hi All,

When I create a Console app in VS.net and run it, the Console window
opens briefly and closes. If I was running a .bat command file, I'd
append a pause stmt at the end. What can I do in VS? I'm a newbie and
keeping that window open would be helpful for studying.

Thanks in advance,
Richard


Aug 30 '05 #5
> Add Console.ReadLine() at the end of Main. That will keep the console open
until you press the "any" key.
That's exactly what I was looking for. And I'm pretty sure I did the
equivalent in Visual C++ years ago!
That should be, until you press "Enter".
Understood!

Many Thanks,
Richard

"Peter Bernhardt" <pe***@spammenot.com> wrote in message
news:e$**************@TK2MSFTNGP11.phx.gbl... That should be, until you press "Enter".

--
Peter Bernhardt
SharpSense Software LLC
pe***@SharpBASSense.netURA
"Peter Bernhardt" <pe***@spammenot.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Add Console.ReadLine() at the end of Main. That will keep the console
open until you press the "any" key.

--
Peter Bernhardt
SharpSense Software LLC
pe***@SharpBASSense.netURA
"Richard Lionheart" <No***@Nowhere.net> wrote in message
news:en**************@TK2MSFTNGP10.phx.gbl...
Hi All,

When I create a Console app in VS.net and run it, the Console window
opens briefly and closes. If I was running a .bat command file, I'd
append a pause stmt at the end. What can I do in VS? I'm a newbie and
keeping that window open would be helpful for studying.

Thanks in advance,
Richard



Aug 30 '05 #6

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

Similar topics

2
by: Ram | last post by:
I have a console application that brings up a dialog if invoked with no command line parameters. If I double click on my application a console window is briefly displayed before the dialog appears...
2
by: John Dalberg | last post by:
I have a closed box system which opens an html page. The page closes by the system. I have access to the html page. I added code to open a child window from this page. However when the parent...
11
by: objectref | last post by:
Hi to all, i have a window app and i want to display some info in a console window. I figured out (after a very long search...) how am i supposed to do it and i try using the following code. ...
2
by: Bumbrlik | last post by:
When I spawn a console application from a another application of mine using _spawnl(_P_NOWAIT, my_program, ......), it opens a new console window but when it is finished the window is...
5
by: Richard Lionheart | last post by:
Hi All, When I create a Console app in VS.net and run it, the Console window opens briefly and closes. If I was running a .bat command file, I'd append a pause stmt at the end. What can I do...
5
by: thinktwice | last post by:
<package> <job id="js"> <script language="JScript"> var WshNetwork = WScript.CreateObject("WScript.Network"); var oDrives = WshNetwork.EnumNetworkDrives(); var oPrinters =...
3
by: Jason | last post by:
I've got a simple program in which I just write something to the console output window, but when I compile and run the program, the output windows displays the output and closes right away. How do...
9
by: wax | last post by:
Hello. // i/o example #include <iostream> using namespace std; int main () { int i;
6
by: Johnnio | last post by:
Hi, I have been wondering how to keep a Console Application open. I have created an asynchronous server with each part in different classes (ClientSocket.cs, ConnectionManager.cs and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.