|
C# A Programmer's Introduction |
|
|
|
Table of Contents ©
1992-2005. Deitel & Associates, Inc. All Rights Reserved.
|
|
|
Preface |
xxx |
|
1 |
Introduction to .NET and C# |
1 |
|
1.1 |
Introduction |
2 |
|
1.2 |
History of the Internet and World Wide Web |
2 |
|
1.3 |
World Wide Web Consortium (W3C) |
4 |
|
1.4 |
Extensible Markup Language (XML) |
4 |
|
1.5 |
Key Software Trend: Object Technology |
5 |
|
1.6 |
Introduction to Microsoft .NET |
7 |
|
1.7 |
C# |
9 |
|
1.8 |
.NET Framework and the Common Language Runtime |
9 |
|
1.9 |
Tour of the Book |
10 |
|
1.10 |
Summary |
17 |
|
1.11 |
Internet and World Wide Web Resources |
19 |
|
2 |
Introduction to the Visual Studio .NET IDE |
21 |
|
2.1 |
Introduction |
22 |
|
2.2 |
Visual Studio .NET Integrated Development
Environment (IDE) Overview |
22 |
|
2.3 |
Menu Bar and Toolbar |
24 |
|
2.4 |
Visual Studio .NET Windows |
26 |
|
2.4.1 |
Solution Explorer |
26 |
|
2.4.2 |
Toolbox |
28 |
|
2.4.3 |
Properties Window |
29 |
|
2.5 |
Using Help |
31 |
|
2.6 |
Simple Program: Displaying Text and an Image |
32 |
|
2.7 |
Summary |
41 |
|
3 |
Introduction to C# Programming |
43 |
|
3.1 |
Introduction |
44 |
|
3.2 |
Simple Program: Printing a Line of Text |
44 |
|
3.3 |
Another Simple Program: Adding Integers |
55 |
|
3.4 |
Memory Concepts |
59 |
|
3.5 |
Arithmetic |
60 |
|
3.6 |
Decision Making: Equality and Relational Operators |
64 |
|
3.7 |
Summary |
69 |
|
4 |
Control Structures: Part 1 |
71 |
|
4.1 |
Introduction |
72 |
|
4.2 |
Algorithms |
72 |
|
4.3 |
Pseudocode |
73 |
|
4.4 |
Control Structures |
73 |
|
4.5 |
if Selection Structure |
76 |
|
4.6 |
if/else Selection Structure |
77 |
|
4.7 |
while Repetition Structure |
82 |
|
4.8 |
Formulating Algorithms: Case Study 1
(Counter-Controlled Repetition) |
83 |
|
4.9 |
Formulating Algorithms with Top-Down, Stepwise
Refinement: Case Study 2 (Sentinel-Controlled Repetition) |
86 |
|
4.10 |
Formulating Algorithms with Top-Down, Stepwise
Refinement: Case Study 3 (Nested Control Structures) |
93 |
|
4.11 |
Assignment Operators |
97 |
|
4.12 |
Increment and Decrement Operators |
98 |
|
4.13 |
Introduction to Windows Application Programming |
101 |
|
4.14 |
Summary |
108 |
|
5 |
Control Structures: Part 2 |
111 |
|
5.1 |
Introduction |
112 |
|
5.2 |
Essentials of Counter-Controlled Repetition |
112 |
|
5.3 |
for Repetition Structure |
114 |
|
5.4 |
Examples Using the for Structure |
118 |
|
5.5 |
switch Multiple-Selection Structure |
124 |
|
5.6 |
do/while Repetition Structure |
127 |
|
5.7 |
Statements break and continue |
130 |
|
5.8 |
Logical and Conditional Operators |
133 |
|
5.9 |
Structured-Programming Summary |
138 |
|
5.10 |
Summary |
144 |
|
6 |
Methods |
146 |
|
6.1 |
Introduction |
147 |
|
6.2 |
Methods in C# |
147 |
|
6.3 |
Math Class Methods |
149 |
|
6.4 |
Methods |
149 |
|
6.5 |
Method Definitions |
151 |
|
6.6 |
Argument Promotion |
162 |
|
6.7 |
C# Namespaces |
164 |
|
6.8 |
Value Types and Reference Types |
165 |
|
6.9 |
Passing Arguments: Pass-by-Value vs.
Pass-by-Reference |
165 |
|
6.10 |
Random-Number Generation |
169 |
|
6.11 |
Example: Game of Chance |
176 |
|
6.12 |
Duration of Variables |
181 |
|
6.13 |
Scope Rules |
182 |
|
6.14 |
Recursion |
184 |
|
6.15 |
Example Using Recursion: The Fibonacci Series |
188 |
|
6.16 |
Recursion vs. Iteration |
191 |
|
6.17 |
Method Overloading |
192 |
|
6.18 |
Summary |
194 |
|
7 |
Arrays |
196 |
|
7.1 |
Introduction |
197 |
|
7.2 |
Arrays |
197 |
|
7.3 |
Declaring and Allocating Arrays |
199 |
|
7.4 |
Examples Using Arrays |
200 |
|
7.4.1 |
Allocating an Array and Initializing Its Elements |
200 |
|
7.4.2 |
Totaling the Elements of an Array |
202 |
|
7.4.3 |
Using Histograms to Display Array Data Graphically |
203 |
|
7.4.4 |
Using the Elements of an Array as Counters |
204 |
|
7.4.5 |
Using Arrays to Analyze Survey Results |
207 |
|
7.5 |
Passing Arrays to Methods |
210 |
|
7.6 |
Passing Arrays by Value and by Reference |
213 |
|
7.7 |
Sorting Arrays |
217 |
|
7.8 |
Searching Arrays: Linear Search and Binary Search |
220 |
|
7.8.1 |
Searching an Array with Linear Search |
220 |
|
7.8.2 |
Searching a Sorted Array with Binary Search |
221 |
|
7.9 |
Multiple-Subscripted Arrays |
225 |
|
7.10 |
foreach Repetition Structure |
232 |
|
7.11 |
Summary |
233 |
|
8 |
Object-Based Programming |
236 |
|
8.1 |
Introduction |
237 |
|
8.2 |
Implementing a Time Abstract Data Type with a Class |
238 |
|
8.3 |
Class Scope |
246 |
|
8.4 |
Controlling Access to Members |
246 |
|
8.5 |
Initializing Class Objects: Constructors |
248 |
|
8.6 |
Using Overloaded Constructors |
249 |
|
8.7 |
Properties |
253 |
|
8.8 |
Composition: Objects References as Instance
Variables of Other Classes |
261 |
|
8.9 |
Using the this Reference |
265 |
|
8.10 |
Garbage Collection |
266 |
|
8.11 |
static Class Members |
268 |
|
8.12 |
const and readonly Members |
272 |
|
8.13 |
Indexers |
275 |
|
8.14 |
Data Abstraction and Information Hiding |
281 |
|
8.15 |
Software Reusability |
282 |
|
8.16 |
Namespaces and Assemblies |
283 |
|
8.17 |
Class View and Object Browser |
288 |
|
8.18 |
Summary |
291 |
|
9 |
Object-Oriented Programming: Inheritance |
292 |
|
9.1 |
Introduction |
293 |
|
9.2 |
Base Classes and Derived Classes |
294 |
|
9.3 |
protected and internal Members |
297 |
|
9.4 |
Relationship between Base Classes and Derived
Classes |
297 |
|
9.5 |
Case Study: Three-Level Inheritance Hierarchy |
318 |
|
9.6 |
Constructors and Destructors in Derived Classes |
321 |
|
9.7 |
Software Engineering with Inheritance |
327 |
|
9.8 |
Summary |
328 |
|
10 |
Exception Handling |
329 |
|
10.1 |
Introduction |
330 |
|
10.2 |
Exception Handling Overview |
331 |
|
10.3 |
Example: DivideByZeroException |
334 |
|
10.4 |
.NET Exception Hierarchy |
339 |
|
10.5 |
finally Block |
340 |
|
10.6 |
Exception Properties |
348 |
|
10.7 |
Programmer-Defined Exception Classes |
353 |
|
10.8 |
Handling Overflows with Operators checked and
unchecked |
357 |
|
10.9 |
Summary |
359 |
|
11 |
Graphical User Interface Concepts |
361 |
|
11.1 |
Introduction |
362 |
|
11.2 |
Windows Forms |
363 |
|
11.3 |
Event-Handling Model |
366 |
|
11.3.1 |
Delegates |
366 |
|
11.3.2 |
Basic Event Handling |
367 |
|
11.4 |
Control Properties and Layout |
371 |
|
11.5 |
Labels, TextBoxes and Buttons |
375 |
|
11.6 |
GroupBoxes and Panels |
382 |
|
11.7 |
CheckBoxes and RadioButtons |
385 |
|
11.8 |
PictureBoxes |
394 |
|
11.9 |
Mouse Event Handling |
396 |
|
11.10 |
Keyboard Event Handling |
398 |
|
11.11 |
Visual Inheritance |
402 |
|
11.12 |
Summary |
405 |
|
12 |
Multithreading |
407 |
|
12.1 |
Introduction |
408 |
|
12.2 |
Thread States: Life Cycle of a Thread |
409 |
|
12.3 |
Thread Priorities and Thread Scheduling |
411 |
|
12.4 |
Summary |
416 |
|
13 |
Strings and Characters |
417 |
|
13.1 |
Introduction |
418 |
|
13.2 |
Fundamentals of Characters and Strings |
418 |
|
13.3 |
String Constructors |
420 |
|
13.4 |
String Indexer, Length Property and CopyTo Method |
421 |
|
13.5 |
Comparing Strings |
423 |
|
13.6 |
String Method GetHashCode |
427 |
|
13.7 |
Locating Characters and Substrings in Strings |
428 |
|
13.8 |
Extracting Substrings from Strings |
431 |
|
13.9 |
Concatenating Strings |
432 |
|
13.10 |
Miscellaneous String Methods |
433 |
|
13.11 |
Class StringBuilder |
435 |
|
13.12 |
StringBuilder Indexer, Length and Capacity
Properties, and EnsureCapacity Method |
437 |
|
13.13 |
StringBuilder Append and AppendFormat Methods |
439 |
|
13.14 |
StringBuilder Insert, Remove and Replace Methods |
443 |
|
13.15 |
Char Methods |
446 |
|
13.16 |
Card Shuffling and Dealing Simulation |
449 |
|
13.17 |
Summary |
453 |
|
14 |
Graphics |
455 |
|
14.1 |
Introduction |
456 |
|
14.2 |
Graphics Contexts and Graphics Objects |
458 |
|
14.3 |
Color Control |
459 |
|
14.4 |
Font Control |
466 |
|
14.5 |
Drawing Lines, Rectangles and Ovals |
469 |
|
14.6 |
Loading, Displaying and Scaling Images |
472 |
|
14.7 |
Summary |
475 |
|
15 |
Files and Streams |
476 |
|
15.1 |
Introduction |
477 |
|
15.2 |
Data Hierarchy |
477 |
|
15.3 |
Files and Streams |
479 |
|
15.4 |
Creating a Sequential-Access File |
480 |
|
15.5 |
Reading Data from a Sequential-Access File |
492 |
|
15.6 |
Summary |
503 |
|
16 |
Database, SQL and ADO .NET |
505 |
|
16.1 |
Introduction |
506 |
|
16.2 |
Relational Database Model |
507 |
|
16.3 |
Relational Database Overview: Books Database |
508 |
|
16.4 |
Structured Query Language (SQL) |
515 |
|
16.4.1 |
Basic SELECT Query |
515 |
|
16.4.2 |
WHERE Clause |
516 |
|
16.4.3 |
ORDER BY Clause |
519 |
|
16.4.4 |
INSERT Statement |
523 |
|
16.4.5 |
UPDATE Statement |
524 |
|
16.4.6 |
DELETE Statement |
525 |
|
16.5 |
ADO .NET Object Model |
526 |
|
16.6 |
Programming with ADO .NET: Extracting Information
from a Database |
527 |
|
16.6.1 |
Connecting to and Querying an Access Data Source |
527 |
|
16.6.2 |
Querying the Books Database |
534 |
|
16.7 |
Summary |
536 |
|
17 |
ASP .NET, Web Forms and Web Controls |
538 |
|
17.1 |
Introduction |
539 |
|
17.2 |
Simple HTTP Transaction |
539 |
|
17.3 |
System Architecture |
542 |
|
17.4 |
Creating and Running a Simple Web Form Example |
543 |
|
17.5 |
Summary |
555 |
|
17.6 |
Internet and World Wide Web Resources |
556 |
|
18 |
Extensible Markup Language (XML) |
557 |
|
18.1 |
Introduction |
558 |
|
18.2 |
XML Documents |
558 |
|
18.3 |
XML Namespaces |
563 |
|
18.4 |
Document Object Model (DOM) |
566 |
|
18.5 |
Summary |
569 |
|
18.6 |
Internet and World Wide Web Resources |
570 |
|
19 |
ASP .NET and Web Services |
572 |
|
19.1 |
Introduction |
573 |
|
19.2 |
Web Services |
574 |
|
19.3 |
Simple Object Access Protocol (SOAP) and Web
Services |
577 |
|
19.4 |
Publishing and Consuming Web Services |
579 |
|
19.5 |
Summary |
594 |
|
20 |
Networking: Streams-Based Sockets |
595 |
|
20.1 |
Introduction |
596 |
|
20.2 |
Establishing a Simple Server (Using Stream Sockets) |
597 |
|
20.3 |
Establishing a Simple Client (Using Stream Sockets) |
598 |
|
20.4 |
Client/Server Interaction with Stream-Socket
Connections |
599 |
|
20.5 |
Summary |
608 |
|
21 |
FCL Collections |
610 |
|
21.1 |
Introduction |
611 |
|
21.2 |
Collection Classes |
611 |
|
21.2.1 |
Class Array |
611 |
|
21.2.2 |
Class ArrayList |
614 |
|
21.2.3 |
Class Stack |
621 |
|
21.2.4 |
Class Hashtable |
625 |
|
21.3 |
Summary |
631 |
|
22 |
Accessibility |
633 |
|
22.1 |
Introduction |
634 |
|
22.2 |
Regulations and Resources |
635 |
|
22.3 |
Web Accessibility Initiative |
637 |
|
22.4 |
Providing Alternatives for Images |
637 |
|
22.5 |
Maximizing Readability by Focusing on Structure |
639 |
|
22.6 |
Accessibility in Visual Studio .NET |
639 |
|
22.6.1 |
Enlarging Toolbar Icons |
640 |
|
22.6.2 |
Enlarging the Text |
641 |
|
22.6.3 |
Modifying the Toolbox |
642 |
|
22.6.4 |
Modifying the Keyboard |
642 |
|
22.6.5 |
Rearranging Windows |
643 |
|
22.7 |
Accessibility in C# |
645 |
|
22.8 |
Accessibility in XHTML Tables |
651 |
|
22.9 |
Accessibility in XHTML Frames |
655 |
|
22.10 |
Accessibility in XML |
656 |
|
22.11 |
Using Voice Synthesis and Recognition with VoiceXML™ |
656 |
|
22.12 |
CallXML™ |
664 |
|
22.13 |
JAWS® for Windows |
669 |
|
22.14 |
Other Accessibility Tools |
670 |
|
22.15 |
Accessibility in Microsoft® Windows® 2000 |
672 |
|
22.15.1 |
Tools for People with Visual Impairments |
673 |
|
22.15.2 |
Tools for People with Hearing Impairments |
675 |
|
22.15.3 |
Tools for Users Who Have Difficulty Using the
Keyboard |
676 |
|
22.15.4 |
Microsoft Narrator |
679 |
|
22.15.5 |
Microsoft On-Screen Keyboard |
682 |
|
22.15.6 |
Accessibility Features in Microsoft Internet
Explorer 6 |
683 |
|
22.16 |
Summary |
685 |
|
22.17 |
Internet and Web Resources |
686 |
|
23 |
Mobile Internet Toolkit |
689 |
|
23.1 |
Introduction |
690 |
|
23.2 |
Mobile Internet Toolkit Client Devices |
690 |
|
23.3 |
Mobile Internet Toolkit and Mobile Web Forms |
691 |
|
23.4 |
Summary |
707 |
|
23.5 |
Internet and Web Resources |
707 |
|
A |
Operator Precedence Chart |
708 |
|
B |
Number Systems |
710 |
|
B.1 |
Introduction |
711 |
|
B.2 |
Abbreviating Binary Numbers as Octal Numbers and
Hexadecimal Numbers |
714 |
|
B.3 |
Converting Octal Numbers and Hexadecimal Numbers to
Binary Numbers |
716 |
|
B.4 |
Converting from Binary, Octal or Hexadecimal to
Decimal |
716 |
|
B.5 |
Converting from Decimal to Binary, Octal or
Hexadecimal |
717 |
|
B.6 |
Negative Binary Numbers: Two’s Complement Notation |
718 |
|
B.7 |
Summary |
719 |
|
C |
Career Opportunities |
721 |
|
C.1 |
Introduction |
722 |
|
C.2 |
Resources for the Job Seeker |
723 |
|
C.3 |
Online Opportunities for Employers |
724 |
|
C.3.1 |
Posting Jobs Online |
726 |
|
C.3.2 |
Problems with Recruiting on the Web |
728 |
|
C.3.3 |
Diversity in the Workplace |
728 |
|
C.4 |
Recruiting Services |
729 |
|
C.5 |
Career Sites |
730 |
|
C.5.1 |
Comprehensive Career Sites |
730 |
|
C.5.2 |
Technical Positions |
731 |
|
C.5.3 |
Wireless Positions |
731 |
|
C.5.4 |
Contracting Online |
732 |
|
C.5.5 |
Executive Positions |
733 |
|
C.5.6 |
Students and Young Professionals |
734 |
|
C.5.7 |
Other Online Career Services |
734 |
|
C.6 |
Summary |
735 |
|
C.7 |
Internet and World Wide Web Resources |
736 |
|
D |
Visual Studio .NET Debugger |
741 |
|
D.1 |
Introduction |
742 |
|
D.2 |
Breakpoints |
743 |
|
D.3 |
Examining Data |
745 |
|
D.4 |
Program Control |
748 |
|
D.5 |
Additional Method Debugging Capabilities |
752 |
|
D.6 |
Additional Class Debugging Capabilities |
754 |
|
D.7 |
Summary |
757 |
|
E |
ASCII Character Set |
759 |
|
F |
Unicode® |
760 |
|
F.1 |
Introduction |
761 |
|
F.2 |
Unicode Transformation Formats |
762 |
|
F.3 |
Characters and Glyphs |
763 |
|
F.4 |
Advantages and Disadvantages of Unicode |
764 |
|
F.5 |
Unicode Consortium’s Web Site |
764 |
|
F.6 |
Using Unicode |
765 |
|
F.7 |
Character Ranges |
768 |
|
F.8 |
Summary |
769 |
|
G |
Introduction to HyperText Markup Language 4: Part 1 |
771 |
|
G.1 |
Introduction |
772 |
|
G.2 |
Markup Languages |
772 |
|
G.3 |
Editing HTML |
773 |
|
G.4 |
Common Elements |
773 |
|
G.5 |
Headers |
776 |
|
G.6 |
Linking |
777 |
|
G.7 |
Images |
779 |
|
G.8 |
Special Characters and More Line Breaks |
783 |
|
G.9 |
Unordered Lists |
785 |
|
G.10 |
Nested and Ordered Lists |
786 |
|
G.11 |
Summary |
789 |
|
G.12 |
Internet and World Wide Web Resources |
790 |
|
H |
Introduction to HyperText Markup Language 4: Part 2 |
791 |
|
H.1 |
Introduction |
792 |
|
H.2 |
Basic HTML Tables |
792 |
|
H.3 |
Intermediate HTML Tables and Formatting |
794 |
|
H.4 |
Basic HTML Forms |
797 |
|
H.5 |
More Complex HTML Forms |
800 |
|
H.6 |
Internal Linking |
807 |
|
H.7 |
Creating and Using Image Maps |
810 |
|
H.8 |
<meta> Tags |
812 |
|
H.9 |
frameset Element |
814 |
|
H.10 |
Nested framesets |
816 |
|
H.11 |
Summary |
818 |
|
H.12 |
Internet and World Wide Web Resources |
820 |
|
I |
HTML Special Characters |
821 |
|
J |
HTML Colors |
822 |
|
K |
Crystal Reports® for Visual Studio .NET |
825 |
|
K.1 |
Introduction |
825 |
|
K.2 |
Crystal Reports Web Site Resources |
825 |
|
K.3 |
Crystal Reports and Visual Studio .NET |
826 |
|
|
Index |
831 |
|
[ top ]
© 1992-2005. Deitel & Associates, Inc. All Rights Reserved.
|