Hello to all
I decided to start a series of articles on the topic of learning programming in .NET, namely in C #. I do not pretend to authorship of everything that will be written hereinafter, I just want to give knowledge to those who wish it.
On Habré many times my comments could be noticed about the fact that I would very much like to train people, but could not figure out how to do it. After the cycle of articles
MaxElc, I thought that I could start writing with him too.
Perhaps we will begin!
.NET architecture
.NET is a runtime environment or platform. It is located between the code and Windows, allowing you to provide the necessary services. The .NET platform consists of two main components. These are
Common Language Runtime and the
.NET Framework Class Library .
The Common Language Runtime (abbreviated CLR) can be called the “engine” of the .NET platform. CLR is engaged in memory management, compilation and code execution, work with control threads, security, etc.
')
The .NET Framework Class Library is a collection of classes for all occasions.
So, to understand how .NET works, let's look at its component parts:
Common Type System (Common Type System, abbreviated CTS) - covers most types found in common programming languages.
Virtual Execution System (Virtual Execution System, abbreviated VES) - is responsible for loading and executing programs written for the CLI.
Metadata System (Metadata System) - designed to describe types, stored in a language independent of a specific programming language.
Common Intermediate Language (Common Intermediate Language, abbreviated as CIL) is a platform-independent object-oriented byte code that acts as the target language for any compiler supporting CLI.
Common Language Specification (CLS) is an agreement between developers of programming languages ​​and developers of class libraries, which defines a subset of CTS and a set of rules.
One of the main ideas of .NET is the compatibility of different services written in different languages. For example, a service written in C ++ for .NET can refer to a class method from a library written in Delphi; in C #, you can write a class inherited from a class written in Visual Basic .NET, and an exception created by a method written in C # can be intercepted and processed in Delphi.
I will not go into details and reprint the textbooks. For those who wish to learn more about .NET, I will leave below links to the necessary resources. Just the whole point comes down to the fact that .NET helps us! And this is very good. =)
Basics of C #
For easy execution of the examples, I recommend that you download the free
Visual Studio 2008 Express , and for whom traffic is not public, you can use
#Develop - this is an open source project with open source.
Let's start with a bit of an example already belligerent - Hello World!
- using System;
-
- class HelloWorld
- {
- public static int Main()
- {
- Console.WriteLine("Hello World!");
- return 0;
- }
- }
* This source code was highlighted with Source Code Highlighter.
Visual Studio #Develop — . :) csc.exe — C#. MS.NET SDK.
IDE Build Project, csc.exe :
csc /out:TargetFile.exe SourceFile.cs
TargetFile.exe — , SourceFile.cs — , .
, .
using System, / .
class HelloWorld — , HelloWorld. , , C# .
Main() — . . Main() . C# ;).
[] _ ([])
{
//
}
. , , , , , . , .
. , , .
. WriteLine() System.Console . return Main(), . Main() int, ( ).
.NET Framework (Wikipedia)
. .NET
NET Framework (MSDN)
Visual Studio 2008 Express
#Develop
C# IDE Mobile
P.S. , .. . . .
P.P.S. MaxElc! =)