Mayfield Global Knowledge Center



How do I write a simple C# program using Visual C# 2005 Express?

  1. Using your desired C# IDE (e.g. Visual Studio 2005, Visual C# 2005 Express Edition, etc.) start a new Console Application (ensure C# is the language selected) then type the following:using System; using System.Collections.Generic; using System.Text; namespace HelloWorld {     class Program     {         static void Main(string[] args)         {             Console.BackgroundColor = ConsoleColor.Black;             Console.ForegroundColor = ConsoleColor.Green;             Console.WriteLine("*** C# Console Example - kb.mayfieldglobal.com ***");             Console.BackgroundColor = ConsoleColor.White;             Console.ForegroundColor = ConsoleColor.Black;             Console.WriteLine("Hello World!");         }     } }
  2. Press Ctrl + F5 to execute the program without debugging. You will see the following output:
    C# Simple Console App

Would you like to...


del.icio.us

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favoritesAdd to favorites

User Opinions (46 votes)

100% thumbs up 0% thumbs down

How would you rate this answer?

Helpful
Not helpful
Thank you for rating this answer.