Visual Studio Problem

Discussion in 'General Microsoft Certifications' started by Toadeh, Mar 29, 2007.

  1. Toadeh

    Toadeh Nibble Poster

    91
    0
    11
    Hi All,

    I have a problem doing the excercises in visual studio. It always wants me to create a console application which is fine but when it runs, the command window just opens then closes.

    Is there any way to keep the command window open until i decide to close it?

    Am using windows xp mainly (but sometimes venture upstairs to me vista box)

    Ta
     
    Certifications: BSc(Hons), MCTS Web Development
  2. Bluerinse
    Honorary Member

    Bluerinse Exabyte Poster

    8,878
    181
    256
    Can't you just run 'cmd' to open the command window and keep it open ie type cmd into the run box first?
     
    Certifications: C&G Electronics - MCSA (W2K) MCSE (W2K)
  3. hbroomhall

    hbroomhall Petabyte Poster Gold Member

    6,624
    117
    224
    This is a classic problem with console apps. I assume that it wants to create a console app because the excercise is a console item.

    The easiest way to fix this is to do as Blue says - open a console and run the command there.

    Another trick is to add a getch() call just before the exit() call. This will mean that the console stays open until you type something.

    Harry.
     
    Certifications: ECDL A+ Network+ i-Net+
    WIP: Server+
  4. Toadeh

    Toadeh Nibble Poster

    91
    0
    11
    Cheers guys, I found another way, add Console.ReadLine() as the last line and it should wait for a key to be pressed.

    Ta though
     
    Certifications: BSc(Hons), MCTS Web Development

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.