Tutorial 1

Okay, lets start from the very beginning. Open up visual studio and Click “File -> New -> Project”. As we’ll be developing C# apps on the Windows PC platform you’ll want to choose “Visual C# -> Console Application″. Now name your project (I’m going with “Tutorial 1″ for simplicity) and click “OK”. There you have it, your very own C# application. Lets take a look at the code that’s been generated:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tutorial1
    class Program
        static void Main(string[] args)

At the moment it’s not that much of an interesting program. You have the main “entry point”:

static void Main(string[] args)

This is where the program starts running. All C# programs of this type start at this point and as you can see the function takes an array of strings. This will allow us to pass in different parameters to our program in future tutorials.
The Main function sits inside a class called “Program” which itself is inside the namespace “Tutorial1”. Namespaces simply allow us to separate out and organise code elements.
The using statements at the top tell our code which types to use from other namespaces and assemblies. There’s quite a few of them up there right now but we don’t need to be too concerned about them (and in fact we’ll be looking into tidying quite a few of those up in future tutorials).
So that’s all there is to it. In the next tutorial we’ll start doing something a bit more interesting and will actually get some output from our C# program.

  1. No comments yet.
  1. No trackbacks yet.

Tell me what you think!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: