Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / General / August 2005

Tip: Looking for answers? Try searching our database.

How to keep Console window open

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Richard Lionheart - 30 Aug 2005 14:57 GMT
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
Metal2You - 30 Aug 2005 15:06 GMT
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.
Richard Lionheart - 30 Aug 2005 15:14 GMT
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
Peter Bernhardt - 30 Aug 2005 15:20 GMT
Add Console.ReadLine() at the end of Main. That will keep the console open
until you press the "any" key.

Signature

Peter Bernhardt
SharpSense Software LLC
peter@SharpBASSense.netURA

> Hi All,
>
[quoted text clipped - 5 lines]
> Thanks in advance,
> Richard
Peter Bernhardt - 30 Aug 2005 16:11 GMT
That should be, until you press "Enter".

Signature

Peter Bernhardt
SharpSense Software LLC
peter@SharpBASSense.netURA

> Add Console.ReadLine() at the end of Main. That will keep the console open
> until you press the "any" key.
[quoted text clipped - 8 lines]
>> Thanks in advance,
>> Richard
Richard Lionheart - 30 Aug 2005 19:46 GMT
> 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

> That should be, until you press "Enter".
>
[quoted text clipped - 10 lines]
>>> Thanks in advance,
>>> Richard

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.