Jump to content

Totally a newbie question, plz help me

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
HONE

HONE

    Newbie

  • Members
  • Pip
  • 3 posts
Hi

this is my first time learning C#.
I tried to create a small program in Visual C# express edition 8
my current Operating System is Window 7

I created test file through "Console Application" option.
My question is that after press "Build" and then run Debug to show the result output on a separated window. However, the resulting window popped up and disappeared right away.
Can anyone tell me how to make the resulting window not disappear so i can check the output easily?


thank you





using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(30);
}
}
}

#2
Guest

Guest

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,414 posts
I am not a C# programmer, but I was able to use Google.
Add this line to your code:
Console.Read();
You probably have to add it right after Console.WriteLine(30);
Root Beer == System Administrator's Beer
Download the new operating system programming kit! (some assembly required)

#3
HONE

HONE

    Newbie

  • Members
  • Pip
  • 3 posts
cool . Thank you for your help. It works

#4
njr1489

njr1489

    Learning Programmer

  • Members
  • PipPipPip
  • 70 posts
If you also press Ctrl+F5 which is "Start Without Debugging" it also accomplishes the same task.

#5
HONE

HONE

    Newbie

  • Members
  • Pip
  • 3 posts
thank you njr1489. That method is perfect.
I kind of remember that there must have some combination keys or put some command system but can't take it out of my memory because the interface of Visual C# is kind of similar to Eclipse