Beruflich Dokumente
Kultur Dokumente
C# 30
C# 3.0
Chapter 1 Introduction
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 2
C# 30
Course Objectives
Learn to program with
ith the C# lang
language
age &
the .NET environment
Discover its concepts and features
Find out where C# follows C++ and where it presents
new concepts and techniques
Deal
D l with
ith severall .NET
NET generall ttopics
i
The .NET p
platform p
provides lots of tools for
developing .NET target applications, as well as
playing a major role in the applications execution
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 3
C# 30
Course Objectives
The .NET
NET en
environment
ironment is a huge
h ge world
orld
We will discuss only those .NET issues that directly
relate to C# programming
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 4
C# 30
Microsoft .NET
NET Initiative
Behind the .NET
NET Framework motivation
stands a vision
To be the best platform for building integrated,
service- oriented applications
Applications that gather information from, and interact
with, a wide variety of sources, regardless of
platforms or languages in use
Introduction 5
C# 30
Microsoft .NET
NET Initiative
In the past,
past creating integrated
pp
was not a simple
p task
applications
It involves a combination of different technologies
For example:
D/COM, WIN32, VBA, Java Applets, ASP/Interdev, ADO,
Introduction 6
C# 30
Microsoft .NET
NET Initiative
The .NET
NET platform simplifies integrated
application development, by:
Replacing old models with new ones
COM Lifetime, Memory, threading, & Error Management
In different
ff
programming languages:
C#, VB.NET, F#, C++/CLI, etc.
Integrating
I t
ti allll kinds
ki d off technologies:
t h l i
A Windows GUI application as a front end to a Web Service
All off th
these are easily
il achieved,
hi
d using
i th
the
unified .NET environment
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 7
C# 30
The .NET
NET Framework
The ttwo
o main .NET
NET Frame
Framework
ork
p
are:
components
The Common Language Runtime (CLR)
The execution engine for .NET Framework applications
A rich runtime, providing applications with lots of important
services
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 8
C# 30
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 9
C# 30
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 10
C# 30
Introduction 11
C# 30
.NET
NET Framework Fundamentals
The .NET
NET framework is a multi
multi-language
language
environment
While the COM model enables interoperation
between different language components, the .NET
enables
bl reall integration
i t
ti between
b t
them:
th
We can reuse code from various languages
We
W can declare
d l
a class
l
iin VB
VB.NET
NET and
dd
derive
i ffrom it iin C#
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 12
C# 30
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 13
C# 30
C# supports
the main features of .NET
pp
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 14
C# 30
CLS
Th Common
C
T
S t
i ttoo bi
i l llanguage
The
Type
System
is
big ffor any single
The Common Language Specification is for cross
cross--language use
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 15
C# 30
A .NET
NET Application General Workflow
Source Code
(in any .NET
aware language)
Compiler
Just-in-time
Compiler
Class loader
Runtime
Platform Specific
Instructions
Target Program
Execution
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 16
C# 30
Create
C
t and
d iinitialize
iti li objects
bj t
Call virtual methods on objects
Manipulate array elements directly
Raise and catch exceptions
Introduction 17
C# 30
MSIL Example
Hello World application in VB
VB.NET
NET
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 18
C# 30
MSIL Example
Hello World application in C#
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 19
C# 30
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
C# 30
Introduction 20
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 21
C# 30
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 22
C# 30
Introduction 23
C# 30
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 24
C# 30
Win32 Replacement
The .NET
NET BCL is designed to simplify
platform service access:
Services are provided through classes
Each class represents a functional entity, and provides all its
related functions
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 25
C# 30
.NET
NET Framework Namespaces
Namespace
System
Core classes and base classes for commonlyused types and operations:
Primitive types and conversions, mathematical
manipulations, garbage collection, exception
handling and more
System.Collections.Generic
System.Data
System Drawing
System.Drawing
System.IO
System.Net
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 26
C# 30
.NET
NET Framework Namespaces
Namespace
System.Diagnostics
System.Reflection
System.Security
System.Serialization
System.Threading
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 27
C# 30
.NET
NET Framework Namespaces
Namespace
System.Configuration
y
System.Web
S t
System.WebServices
W bS i
Cl
Classes
ffor creating
ti and
d using
i W
Web
bS
Services
i
System.Windows.Forms
System.Xml
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel
Introduction 28
C# 30
Chapter Summary
Course
Co rse Introd
Introduction
ction
In this course you will learn how to program with the
C# language & the .NET environment
The .NET environment is a huge
g world,, this course,,
however, will discuss only those .NET issues that
directly relate to C# programming
Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel