Tutorials

Welcome to the C# Tutorial section. This is a set of lessons these lessons will range from beginning to intermediate programming for anyone interested in learning C# programming language.

Lesson 1.
In this lesson we will learn the very basics of the c# language.
The first line of the code listed is the namespace.  a namspace is basicly an address or location in which classes are kept, our Program is located as Welcome.Program and could be invoked like
the Console.Out.WriteLine(... by Calling Welcome.Program.Main(null).
You may now be thinking that Console is a namespace but this is untrue.  This is because we have declared we will be using the System namespace and Console is a class in that namespace.
we could write System.Console.Out.Write("Please... write but you may notice that lines could become excessively long.

Following that we use the word class.  What is a class? Well simply it's to be considered a classification of an object.  This object is a Program. Objects can have values but because this is the first lesson we wont worry about it until we have a handle on creating a program and running it.

Code Listing.
namespace Welcome{
 using System;
  class Program{
   ///
    /// This is where a console application starts from.
    /// Arguments from the command line.
    static void Main(string[] args)
    {
      // Let's put in some code
      Console.Out.Write("Please enter your name: "); //Output's a line of text.
      var name = Console.In.ReadLine(); // Reads a line of text.
      Console.Out.WriteLine("Welcome " + name + " let's learn C#.");
      // Output's a line of text with a new line.
      Console.In.Read(); // Reads any key.
     }
   }
}