Description: This document is a tutorial in a series of
tutorials for programmers learning about the .NET Framework development
environment. What you will learn is what
C# is, how it fits into the .NET Framework.
You will also learn how to write a simple C# program as well as gain a
taste for the possibilities of this new platform.
Requirements: You should be familiar with at least one programming language, such as C++, Pascal, PERL, Java or Visual Basic. You should have some comfort with object oriented concepts such as instantiating and using objects. You should be comfortable with general computer science concepts. To do the exercises and run the examples you need a PC running Windows with the .NET Framework installed.
1.2 C# and
the .NET Framework Class Library (FCL)
1.3 Minimal
Requirements to Use C#
2.1 Creating
Console Assemblies
2.3 Creating
Code Library Assemblies
4.5 Reference
Types and Value Types
5 Simple
Object Oriented Programming
6.1 C#Pad.exe
– Sample Application
Figure
3‑1 New Project in VS.NET
Figure
4‑2 Primitive Code Snippit
(Excerpted from Language.cs)
Figure
4‑4 Methods Code Snippit
(Excerpted From Language.cs)
Figure
4‑5 Array Declaration Code Snippit
(Excerpted from Language.cs)
Figure
4‑6 if Code Snippit (Excerpted
from Language.cs)
Figure
4‑7 switch Code Snippit (Excerpted
from Language.cs)
Figure
4‑8 Looping Code Snippit
(Excerpted from Language.cs)
Figure
4‑9 Exception Code Snippit
(Excerpted from Language.cs)
Exercise
1‑1 Building and Running
HelloGUI.cs
Exercise
2‑1 Build and Run a Console
Application
Exercise
2‑2 Build and Run a GUI Application
Exercise
2‑3 Build a Code Library
Exercise
2‑4 Build an App to Test a Code
Library
C# (or C-Sharp) is a new programming language. C# is used to write software that runs on the .NET Framework. Although C# is not the only language that you can use to target the .NET Framework, C# is one of the most popular because of its simplified C-based syntax.
Usually, an introductory text to a computer language begins by telling you what you can do with a language as well as where the software you build with the language can run. I would like to address these points right away with C#, since they can be a little confusing.
In brief, C# (unlike C++, PERL, COBOL, Pascal, etc.) is a
language that targets one and only one platform. This platform is the .NET Framework. However, the .NET Framework itself is a
computing platform that is designed to be hosted by any operating system. At the
time of this writing the .NET Framework runs on Windows operating systems, and
I know of two other major
The relationship between C# and the .NET Framework is somewhat unique. In a way it is similar to the relationship between Java and the Java Virtual Machine, however there are several major differences. First, C# is not the only language that can be used to write .NET Framework applications (called Managed Applications). Second, .NET or managed, applications run in native machine-language and are not interpreted. Third, C# or managed applications do not run in a sandbox.
What you should take away from this introduction, as a programmer learning C#, is that C# is a programming language (that you will find simple to master); however, much of what you can do with C# is really more a part of the .NET Framework itself. C# is a language with syntax so simple that most programmers will be comfortable with it in no time, but the .NET Framework is a platform so powerful that developers will continue to learn the ins and outs of it for years.