- 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!"); } } }
-
Press Ctrl + F5 to execute the program without debugging. You will see the following output:
