In this tutorial we’ll start looking at the C# programming language. C# is a popular programming language that can be used to create programs for tablets, phones, web servers, and desktops. The Syntax of C# is similar to Java, C++, and JavaScript and is one of many languages that can be used for .NET programming. If you’re ready to learn about programming in C#, Microsoft makes available a wonderful community edition of their powerful Visual Studio IDE. We’ll make use of Visual Studio Community during these next few C# tutorials.

Download And Install Visual Studio Community

By using the link above, you’ll be able to install Visual Studio Community. Once installed, the initial start page looks like this.

The .NET Framework

With Visual Studio now installed, the. NET Framework is also installed since it is part of the Visual Studio installation. Writing applications in C# with Visual Studio leverages the. NET Framework. This means applications can take advantage of all kinds of services that the framework provides. This includes things like saving information to a database, reading information from an XML file, as well as configuration, network operations, and all the basic core features that nearly every application needs. C# can therefore be used to build business applications, games, web apps, and applications that run on tablets or mobile devices. The .NET Framework does it’s work by way of the Common Language Runtime and the Framework Class Library.

The CLR manages your application

  • Memory management
  • Operating system and hardware independence
  • Language independence

Framework class library

  • A library of functionality to build applications

Working With C#

C# is a popular language and nice to work with if you are familiar with C, C++, Java, and JavaScript. Let’s use Visual Studio to create our first C# program. C# is a compiled language, so in order to actually see the results of the code you write, you will need to compile it first. Let’s see how to create a super simple console application in Visual Studio now. You can select File->New->Project->Visual C#-> Console App(.NET Framework).

Visual Studio will set up some boilerplate code for us which looks like this.

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

namespace WelcomeToCSharp
{
    class Program
    {
        static void Main(string[] args)
        {
        }
    }
}

Solution Explorer In Visual Studio

Once the new project is created, we also see the solution explorer. The Solution Explorer window organizes all of the projects code and as well as other projects. In the screenshot below, we see that WelcomeToCSharp is highlighted which represents the current project. Inside of that project we have three folders. Those are bin, obj, and Properties. There is also an App.config file, a Program.cs file, and a Visual C# Project File named WelcomeToCSharp.csproj.

#csharp 
 

Introduction To C# And Visual Studio For Beginners
1.80 GEEK