Introducing the
Microsoft .NET
Platform
Solutions in this chapter:
■
Introducing the .NET Platform
■
Features of the .NET Platform
■
Components of the .NET Architecture
■
Exploring the Code Cycle
■
The Pursuit of Standardization
; Summary
; Solutions Fast Track
; Frequently Asked Questions
Chapter 1
1
167_C#_01.qxd 11/30/01 4:30 PM Page 1
1 YEAR UPGRADE
BUYER PROTECTION PLAN
Saurabh Nandu
Technical Editor
Everything a Web Developer Needs to Quickly and Easily Build
Solutions for the Microsoft .NET Platform Using C#
• Step-by-Step Instructions for Using C# Components to Build Web Services
and Applications That Are Available Across the Internet
• Hundreds of Developing & Deploying and Debugging Sidebars,Security
Alerts,and C# .NET FAQs
• Complete Coverage of How C and C++ Developers Can Use Existing Skills to
Build XML-Based .NET Applications with C#
C# .NET
Web Developer’s Guide
Contents
i
Chapter 1 Introducing the
Microsoft .NET Platform 1
Introduction 2
Introducing the.NET Platform 2
Microsoft .NET and Windows DNA 3
Microsoft .NET Architecture Hierarchy 4
Features of the .NET Platform 5
Multilanguage Development 5
Platform and Processor Independence 7
Automatic Memory Management 7
Versioning Support 8
Support for Open Standards 9
Easy Deployment 9
Distributed Architecture 10
Interoperability with Unmanaged Code 11
Security 12
Performance and Scalability 14
Components of the .NET Architecture 14
.NET Runtime 14
Managed/Unmanaged Code 14
Intermediate Language 15
Common Type System 15
.NET Base Classes 15
Assemblies 16
Metadata 16
Assemblies and Modules 17
Assembly Cache 18
Reflection 19
167_C#_toc.qxd 11/30/01 6:21 PM Page i
ii Contents
Just In Time Compilation 19
Garbage Collection 20
Exploring the Code Cycle 21
The Pursuit of Standardization 24
Summary 26
Solutions Fast Track 27
Frequently Asked Questions 30
Chapter 2 Introducing C# Programming 33
Introduction 34
Getting Started 35
Creating Your First C# Program 37
Compiling and Executing 38
Defining a Class 40
Declaring the Main Method 43
Organizing Libraries with Namespaces 43
Using the using Keyword 44
Adding Comments 45
Introducing Data Types 47
Value Types 47
Primitive Data Types 47
Reference Types 48
Explaining Control Structures 49
Using the if Statement 49
Using the if-else Statement 50
Using the switch case Statement 50
Using the for Statement 51
Using the while Statement 52
Using the do while Statement 52
Using the break Statement 52
Using the continue Statement 53
Using the return Statement 54
Using the goto Statement 55
Understanding Properties and Indexers 56
Using Properties 56
Get Accessor 59
Set Accessor 59
167_C#_toc.qxd 11/30/01 6:21 PM Page ii
Contents iii
Accessing Lists with Indexers 60
Using Delegates and Events 69
Delegates 70
Single Cast 74
Multicast 75
Events 79
Using Exception Handling 85
Using the try Block 89
Using the catch Block 89
Using the finally Block 89
Using the throw Statement 89
Understanding Inheritance 90
Summary 103
Solutions Fast Track 104
Frequently Asked Questions 107
Chapter 3 Visual Studio.NET IDE 109
Introduction 110
Introducing Visual Studio.NET 110
Components of VS.NET 112
Design Window 112
Code Window 113
Server Explorer 114
Toolbox 116
Docking Windows 117
Properties Explorer 117
Solution Explorer 118
Class View 119
Dynamic Help 120
Task List Explorer 121
Features of VS.NET 122
IntelliSense 122
XML Editor 124
Documentation Generation
(XML Embedded Commenting) 127
Adding XML Document Comments
to C# Pages 127
167_C#_toc.qxd 11/30/01 6:21 PM Page iii