If you are viewing this post from the homepage, please click on the link below to see the full post:
You can download the free version of Microsoft’s Visual C# 2010 Express from Microsoft here, by clicking on C# in the left column and then selecting your language (probably English, if you can read this) from the drop down menu, like so:
You will be taken to a page which thanks you for downloading. Once the download has started it’s pretty self explanatory – just follow the steps in the wizard. You won’t need any of the optional extras for this tutorial. Whilst in the early phases of the download, you might be required to install other software, because programming software requires a lot of up to date other pieces of software. Eventually, there will be a window with all the separate parts listed, indicating whether they have been downloaded, and whether they have been installed. There is a large general progress bar at the bottom.
Halfway through the installation, you might be told to restart your computer, so save any other tasks you might have been doing and restart. The installation should automatically continue when you start back up. When everything has downloaded and installed, start the software from the start menu. This should appear whilst the software loads:
It will take longer the first time because the software has to initialize itself.
Once the software has started up, the start page will appear. It should look like this:
(To see a larger version, click the image)
This is the main page, where you can read programming news, open recent projects, and start new ones. To start a new project, click the new project button, just under file, and the new project window should appear.
Click on console application, then type a name in at the bottom and click OK.
Your project will be created, and opened for editing.
The large box is where the code of the program is typed and edited. When you create a new project, there will be some code already there for you. Certain words are highlighted in different colours:
Important keywords are dark blue
Class names are light blue
Comments are green
(We will cover these things later)
Errors and warnings appear in the box at the bottom, with their line number so you can find them, but errors are also underlined in the code box, like spelling mistakes are in Word.
C# programs must be compiled into machine code before the computer can run them, and that’s what the Debug button does. When you finish typing a program, you press that and the compiler will build the machine code. Any errors it encounters will appear in the error box at the bottom. If there were errors that meant the compiler could not create the machine code, it will ask you if you want to run the last successful build. If this happens, you should usually say no, then fix the errors before compiling again.
If you press debug now, it will compile and run the code which is already there. There shouldn’t be any errors, but not much will happen because it is an ’empty’ program, which doesn’t actually produce any output. An old-fashioned window which looks like command prompt will appear and then disappear.
We will create our first program in the next installment of the tutorial, Part 1.0, and gain an understanding of what each statement is.
Please Note: After a few days, the trial version of C# will ask you for a registration key, and give you a link to obtain one online. Just follow the link, login with your Windows Live ID and enter the information required.