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 intothe .NET Framework. You will also learn how to write a simple C# program as well as gain a tastefor 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 conceptssuch 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 Windowswith the .NET Framework installed.
Table of Contents
Table of Contents ................................................................................................. 1
Figures and Exercises .......................................................................................... 3
1
Introducing C# ............................................................................................... 4
1.1
HelloWorld a-la C# ................................................................................. 4
1.2
C# and the .NET Framework Class Library (FCL) .................................. 6
1.3
Minimal Requirements to Use C# ........................................................... 6
2
C# Applications.............................................................................................. 7
2.1
Creating Console Assemblies ................................................................ 8
2.2
Creating GUI Assemblies ..................................................................... 10
2.3
Creating Code Library Assemblies ....................................................... 12
3
Visual Studio.NET ....................................................................................... 16
3.1
Creating a Project ................................................................................. 16
3.2
Working with Projects ........................................................................... 18
4
Language Concepts .................................................................................... 18
4.1
Syntax Ground Rules ........................................................................... 19
4.2
Primitive Types ..................................................................................... 19
4.3
Expressions and Operators .................................................................. 21
4.4
Methods ............................................................................................... 22
4.5
Reference Types and Value Types ...................................................... 23
4.6
Arrays of Data ...................................................................................... 24
4.7
Conditional Statements ........................................................................ 25
4.8
Loops ................................................................................................... 26
4.9
Error Handling ...................................................................................... 26
5
Simple Object Oriented Programming ......................................................... 27
5.1
Using Types ......................................................................................... 27