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

System Console question

Rob
When issuing...

System.Console.Write and WriteLine commands... the program shells out to
Command prompt, displays message, and closes... there is no time to view
what is shown,,, how can you keep the console up in order to view the
contents ?

Thanks
Nov 23 '05 #1
4 1299

Rob wrote:
When issuing...

System.Console.Write and WriteLine commands... the program shells out to
Command prompt, displays message, and closes... there is no time to view
what is shown,,, how can you keep the console up in order to view the
contents ?


Put Console.ReadLine() at the end of your program. This will make the
console window wait for an <Enter> before closing.

--
Larry Lard
Replies to group please

Nov 23 '05 #2
"Rob" <rw*****@comcast.net> schrieb:
System.Console.Write and WriteLine commands... the program shells out to
Command prompt, displays message, and closes... there is no time to view
what is shown,,, how can you keep the console up in order to view the
contents ?


This behavior is by design. Typically console applications are launched
from a console window, for example in a "cmd" console. After execution of
the program is finished the console returns to the command prompt.

I agree with you that this makes debugging of console applications from
within the IDE complicated. You can overcome this issue by addign the
following code to the end of your 'Sub Main':

\\\
#If DEBUG Then
Console.Read()
#End If
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 23 '05 #3
I wouldn't bother using the DEBUG directive like in Herfried's example
because it isn't needed at all. Just do the 'Console.ReadLine()' like the
other user suggested.

Crouchie1998
BA (HONS) MCP MCSE
Nov 23 '05 #4
"Crouchie1998" <cr**********@spamcop.net> schrieb:
I wouldn't bother using the DEBUG directive like in Herfried's example
because it isn't needed at all. Just do the 'Console.ReadLine()' like the
other user suggested.


IIRC this will prevent the application from exiting automatically when it is
being launched within a command window.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 23 '05 #5

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

Similar topics

5
by: Abraham Lopez | last post by:
Hi.. Is there a way to convert a System.Array to XML... If you know thanks very much... if you don't... Please do not respond stupid things like " Yes -- many ways."
2
by: Jack David | last post by:
Using the code below I am able to monitor a single directory for a new file and then kick-off a process to deal with the file. The question is??? How would I modify this code to be able to monitor...
4
by: Hagay Lupesko | last post by:
Hi, I've encountered a strange phenomena which appears to me as a bug: I have an engine that uses a System.Threading.Timer to invoke a delegate every X minutes. The code looks something...
12
by: newsgroupie | last post by:
Hi Newsgroupies, I'm writing a Web Forms program using C# (VS.NET 2003) and trying to monitor it whilst running using "System.Console.WriteLine(<params>)" but can't for the life of me find where...
5
by: Deiussum | last post by:
I'm running into an issue where I have a timer that appears to be timing out immediately, when it shouldn't be timing out for about int.MaxValue milliseconds. I have written a small app that...
20
by: djc | last post by:
I get this *intermittently* on a utility I am working on. I don't know whats going on but here are a few points about it: - using VS 2005, running on xp sp2 - program uses multiple threadpool...
2
by: stevie.greenslade | last post by:
'Lo all. I have a simple question I'd like help on. :] How, if at all, would one go about suppressing the console window that flashes up when you make at system() call in your C++ program? I'm...
8
by: Anthony P. | last post by:
Hello Everyone, I am building an application and I need to walk the file system from the root directory on down. I need to cover every single directory on the system and all of their sub...
9
by: garyusenet | last post by:
I am using a C# solution that somebody kindly sent me. It was a console application. I am trying to get use of the MessageBox. I have added the following using directive to the namespaces at...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.