-
Step 1
Download and install the Microsoft standard development package from the uniform resource locator (URL) located in the resources.
-
Step 2
Open your text editor and click File, then New to start a new document. Save the file as HelloWorld.cs.
-
Step 3
Type the following code at the beginning of the text document:
using System;
using System.Windows.Forms;
/* The "using System" statement in a C# program makes use of the C# System namespace and "System.Windows.Forms" uses the Form namespace to display "Hello World" on a message dialogue to the user in a later step in the program. */ -
Step 4
Add to the C# file the following code:
class Hello
{
static void Main()
{
MessageBox.Show("Hello World");
}
}
/*
The MessageBox.Show method will display the text contained in the statement to the system alert generated by the MessageBox.Show method. */ -
Step 5
Open the command line prompt on your computer by clicking Start, then Run and typing command in the text field. Type cd c:\csharpe and press Enter. Type csc HelloWorld.cs and press Enter.
-
Step 6
At the command prompt, type HelloWorld.exe and press Enter to run your first C# program.













