I.T. Discussion Community!
-Collapse +Expand
C#
Search C# Group:

Advanced
-Collapse +Expand C# To/From
To/FromCODEGuides
-Collapse +Expand C# Study Test
PRESTWOODCERTIFIED
-Collapse +Expand C# Store
PRESTWOODSTORE

Prestwood eMagazine

March Edition
Subscribe now! It's Free!
Enter your email:

   ► KBProgrammingC#   Print This     
  From the December 2015 Issue of Prestwood eMag
 
A 10 Minute C# Console Application Quick Start
 
Posted 11 years ago on 10/8/2008 and updated 12/6/2008
Take Away:

This will show how to make a "hello world" console application in Visual Studio 2008 with C#. Let VS.Net do the work and create a new console application using the menu. Use Console.WriteLine and Console.ReadLine for simple input and output.

KB101322



Got 10 minutes? Want to get started with C# Console Application?

This article is part of our series of 10 Minute Quick Starts. Each quick start is step by step, assumes you know very little about the subject, and takes about 10 minutes. You can use them to scratch the service of areas you want to learn and as a quick review when returning to something after a long absence.

C# Console Application

This will show how to make a "hello world" console application in Visual Studio 2008 with C#.

Setup

To get started, you have to have Visual Studio.Net installed. This article is based on Visual C# 2008 but you can use any version you wish (there may be slight variations in menu options but we try to keep our 10 Minute Quick Starts as generic as possible).

If you don't have the full version of Visual Studio .Net, you can download Visual Basic .Net Express Edition:

And, here, we, go...

  1. Launch Visual C# 2008.
  2. File | New Project
  3. In the dialog box,
    1. select "Console Application" icon
    2. Name: Hello

      You can change the name of the project later but it's easiest to specify a project name now.
       
      The following screen clip is from VS.Net 2008. If you're using Visual C# 2008, you're screen shot will look slightly different.
      Visual Studio 2008 C# Console application
       
    3. Wait...
  4. Find the section that says:

            static void Main(string[] args)
            {
            }


    and add

            static void Main(string[] args)
            {
                Console.WriteLine("Hello World");
            }

  5. Run-it! Press Control+F5 (or click Debug | Start Without Debugging)

    Note Using F5 (start debugging) will cause the program to rapidly run and exit.  Use Control+F5 to make the Application pause when it finishes.
     
    Hello World Cmd

That's it! You have created a console app. 

To get the exe file for deployment...

  • From the main menu, Debug | Publish Hello,
  • Follow the wizard instructions.

Comments

0 Comments.
Share a thought or comment...
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1252A1
Enter key:
Article Contributed By Bryan Valencia:

Bryan Valencia is the author of millions of lines of code and writes for PrestwoodBoards and Visual Studio Journey on-line magazines.

Visit Profile

 KB Article #101322 Counter
14577
Since 10/8/2008
-
   Contact Us!
 
PrestwoodBoards.com was developed and is maintainted by me. Do you have a question or suggestion? Do you see a problem? Contact me now. My goal is to build an ad-free and spam-free source of I.T. information with many contributers (ok to promote your website/company in your bio). Yes, my company Prestwood IT Solutions is mentioned in my bio which shows with every post, but you can contribute and promote your pet project too!

1,977 People Online Now!!  
Sign In to see who's online now!  Not a member? Join now. It's free!
Show more stats...


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech