application “Microsoft Visual Studio .NET 2003”
- In the
“start page” of Microsoft Visual Studio .NET, choose new project
“New Project” window, under “Project Types” choose “Visual C# Projects”,
“Console Application” – to develop command line programs
choose “Windows Application” – to develop GUI components by drag and drop
simple C# program, we will choose Console Application
under “Name”, call it “FirstProgram”, under location
can choose default location given
choose desktop or folder of your choice.
this point the following class appears as in Figure 1.
.NET environment adds some code pertaining to namespace, which is not
necessary for the 1st and simple program. Therefore, let’s
modify it so that you are aware of the essentials
of a basic C# program. See Figure 2.
you can rename the class name, to anything you which, by right clicking
on “Class1.cs”, in the “Solution Explorer” frame and clicking on “rename”.
When you do this you must also delete “Class1” in the code view to
whatever you called the class. See Figure 3.
add the following code in the “Main” method
is my first C# program!”);
this point, the class should look like as it does in Figure 4.
to compile the program,
the “Build” menu item from the top menu
select “Build Solution” from the drop down.
At the bottom of the window, the
message “Build succeeded” should appear, informing of successful compilation.
to run the program,
“Debug” menu item from the top menu
select “Start Without Debugging” from the drop down.
At this point, a new window should
appear as in Figure 5.
- You can
go back add other code, recompile and rerun the program to see the changes
you have made.