| Preface | xxxvii |
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 | 19 |
1.11 | Internet and World Wide Web Resources | 21 |
2 | Introduction to the Visual Studio .NET IDE and C# Programming | 22 |
2.1 | Introduction | 23 |
2.2 | Visual Studio .NET Integrated Development Environment (IDE) Overview | 24 |
2.3 | Menu Bar and Toolbar | 27 |
2.4 | Visual Studio .NET Windows | 29 |
2.4.1 | Solution Explorer | 29 |
2.4.2 | Toolbox | 30 |
2.4.3 | Properties Window | 31 |
2.5 | Using Help | 33 |
2.6 | Simple Program: Displaying Text and an Image | 34 |
2.7 | Simple Program: Printing a Line of Text | 43 |
2.8 | Arithmetic | 52 |
2.9 | Decision Making: Equality and Relational Operators | 53 |
2.10 | Summary | 58 |
3 | Control Structures | 60 |
3.1 | Introduction | 61 |
3.2 | Control Structures | 61 |
3.3 | if Selection Structure | 63 |
3.4 | if/else Selection Structure | 63 |
3.5 | while Repetition Structure | 64 |
3.6 | Assignment Operators | 67 |
3.7 | Increment and Decrement Operators | 67 |
3.8 | for Repetition Structure | 69 |
3.9 | Example: Using the for Structure to Compute Compound Interest | 71 |
3.10 | switch Multiple-Selection Structure | 76 |
3.11 | do/while Repetition Structure | 80 |
3.12 | Statements break and continue | 81 |
3.13 | Logical and Conditional Operators | 84 |
3.14 | Introduction to Windows Application Programming | 88 |
3.15 | Summary | 95 |
4 | Methods and Arrays | 97 |
4.1 | Introduction | 98 |
4.2 | Methods in C# | 99 |
4.3 | Method Definitions | 99 |
4.4 | Argument Promotion | 106 |
4.5 | C# Namespaces | 108 |
4.6 | Value Types and Reference Types | 109 |
4.7 | Passing Arguments: Pass-by-Value vs. Pass-by-Reference | 110 |
4.8 | Scope Rules | 114 |
4.9 | Recursion | 117 |
4.10 | Method Overloading | 119 |
4.11 | Arrays | 122 |
4.12 | Declaring and Allocating Arrays | 123 |
4.13 | Passing Arrays to Methods | 126 |
4.14 | Passing Arrays by Value and by Reference | 126 |
4.15 | Multiple-Subscripted Arrays | 130 |
4.16 | foreach Repetition Structure | 135 |
4.17 | Summary | 136 |
5 | Object-Based Programming | 137 |
5.1 | Introduction | 138 |
5.2 | Implementing a Time Abstract Data Type with a Class | 139 |
5.3 | Class Scope | 147 |
5.4 | Controlling Access to Members | 147 |
5.5 | Initializing Class Objects: Constructors | 149 |
5.6 | Using Overloaded Constructors | 150 |
5.7 | Properties | 154 |
5.8 | Composition: Objects References as Instance Variables of Other Classes | 161 |
5.9 | Using the this Reference | 165 |
5.10 | Garbage Collection | 167 |
5.11 | static Class Members | 168 |
5.12 | const and readonly Members | 173 |
5.13 | Indexers | 175 |
5.14 | Data Abstraction and Information Hiding | 181 |
5.15 | Software Reusability | 183 |
5.16 | Namespaces and Assemblies | 183 |
5.17 | Class View and Object Browser | 189 |
5.18 | Summary | 191 |
6 | Object-Oriented Programming: Inheritance | 192 |
6.1 | Introduction | 193 |
6.2 | Base Classes and Derived Classes | 194 |
6.3 | protected and internal Members | 197 |
6.4 | Relationship between Base Classes and Derived Classes | 197 |
6.5 | Case Study: Three-Level Inheritance Hierarchy | 218 |
6.6 | Constructors and Destructors in Derived Classes | 221 |
6.7 | Software Engineering with Inheritance | 227 |
6.8 | Summary | 228 |
7 | Object-Oriented Programming: Polymorphism | 229 |
7.1 | Introduction | 230 |
7.2 | Derived-Class-Object to Base-Class-Object Conversion | 230 |
7.3 | Type Fields and switch Statements | 237 |
7.4 | Polymorphism Examples | 238 |
7.5 | Abstract Classes and Methods | 239 |
7.6 | Example: Inheriting Interface and Implementation | 241 |
7.7 | sealed Classes and Methods | 249 |
7.8 | Example: Payroll System Using Polymorphism | 250 |
7.9 | Example: Creating and Using Interfaces | 260 |
7.10 | Delegates | 272 |
7.11 | Operator Overloading | 277 |
7.12 | Summary | 282 |
8 | Exception Handling | 284 |
8.1 | Introduction | 285 |
8.2 | Exception Handling Overview | 286 |
8.3 | Example: DivideByZeroException | 289 |
8.4 | .NET Exception Hierarchy | 294 |
8.5 | finally Block | 295 |
8.6 | Exception Properties | 303 |
8.7 | Programmer-Defined Exception Classes | 308 |
8.8 | Handling Overflows with Operators checked and unchecked | 312 |
8.9 | Summary | 314 |
9 | Graphical User Interface Concepts: Part 1 | 316 |
9.1 | Introduction | 317 |
9.2 | Windows Forms | 318 |
9.3 | Event-Handling Model | 321 |
9.3.1 | Basic Event Handling | 322 |
9.4 | Control Properties and Layout | 326 |
9.5 | Labels, TextBoxes and Buttons | 330 |
9.6 | GroupBoxes and Panels | 337 |
9.7 | CheckBoxes and RadioButtons | 340 |
9.8 | PictureBoxes | 349 |
9.9 | Mouse Event Handling | 351 |
9.10 | Keyboard Event Handling | 353 |
9.11 | Summary | 357 |
10 | Graphical User Interface Concepts: Part 2 | 358 |
10.1 | Introduction | 359 |
10.2 | Menus | 359 |
10.3 | LinkLabels | 368 |
10.4 | ListBoxes and CheckedListBoxes | 372 |
10.4.1 | ListBoxes | 375 |
10.4.2 | CheckedListBoxes | 377 |
10.5 | ComboBoxes | 380 |
10.6 | TreeViews | 385 |
10.7 | ListViews | 391 |
10.8 | Tab Control | 398 |
10.9 | Multiple-Document-Interface (MDI) Windows | 403 |
10.10 | Visual Inheritance | 412 |
10.11 | User-Defined Controls | 416 |
10.12 | Summary | 421 |
11 | Multithreading | 423 |
11.1 | Introduction | 424 |
11.2 | Thread States: Life Cycle of a Thread | 425 |
11.3 | Thread Priorities and Thread Scheduling | 427 |
11.4 | Thread Synchronization and Class Monitor | 432 |
11.5 | Producer/Consumer Relationship without Thread Synchronization | 434 |
11.6 | Producer/Consumer Relationship with Thread Synchronization | 440 |
11.7 | Producer/Consumer Relationship: Circular Buffer | 449 |
11.8 | Summary | 460 |
12 | Strings, Characters and Regular Expressions | 462 |
12.1 | Introduction | 463 |
12.2 | Fundamentals of Characters and Strings | 463 |
12.3 | String Constructors | 465 |
12.4 | String Indexer, Length Property and CopyTo Method | 466 |
12.5 | Comparing Strings | 468 |
12.6 | String Method GetHashCode | 472 |
12.7 | Locating Characters and Substrings in Strings | 473 |
12.8 | Extracting Substrings from Strings | 476 |
12.9 | Concatenating Strings | 477 |
12.10 | Miscellaneous String Methods | 478 |
12.11 | Class StringBuilder | 480 |
12.12 | StringBuilder Indexer, Length and Capacity Properties, and EnsureCapacity Method | 482 |
12.13 | StringBuilder Append and AppendFormat Methods | 484 |
12.14 | StringBuilder Insert, Remove and Replace Methods | 488 |
12.15 | Char Methods | 491 |
12.16 | Card Shuffling and Dealing Simulation | 494 |
12.17 | Regular Expressions and Class Regex | 498 |
12.18 | Summary | 509 |
13 | Graphics and Multimedia | 510 |
13.1 | Introduction | 511 |
13.2 | Graphics Contexts and Graphics Objects | 513 |
13.3 | Color Control | 514 |
13.4 | Font Control | 522 |
13.5 | Drawing Lines, Rectangles and Ovals | 527 |
13.6 | Drawing Arcs | 530 |
13.7 | Drawing Polygons and Polylines | 533 |
13.8 | Advanced Graphics Capabilities | 537 |
13.9 | Introduction to Multimedia | 543 |
13.10 | Loading, Displaying and Scaling Images | 544 |
13.11 | Animating a Series of Images | 546 |
13.12 | Windows Media Player | 559 |
13.13 | Microsoft Agent | 562 |
13.14 | Summary | 576 |
14 | Files and Streams | 578 |
14.1 | Introduction | 579 |
14.2 | Data Hierarchy | 579 |
14.3 | Files and Streams | 581 |
14.4 | Classes File and Directory | 583 |
14.5 | Creating a Sequential-Access File | 593 |
14.6 | Reading Data from a Sequential-Access File | 605 |
14.7 | Random-Access Files | 616 |
14.8 | Creating a Random-Access File | 620 |
14.9 | Writing Data Randomly to a Random-Access File | 624 |
14.10 | Reading Data Sequentially from a Random-Access File | 629 |
14.11 | Case Study: A Transaction-Processing Program | 634 |
14.12 | Summary | 654 |
15 | Extensible Markup Language (XML) | 656 |
15.1 | Introduction | 657 |
15.2 | XML Documents | 657 |
15.3 | XML Namespaces | 662 |
15.4 | Document Object Model (DOM) | 665 |
15.5 | Document Type Definitions (DTDs), Schemas and Validation | 683 |
15.5.1 | Document Type Definitions | 684 |
15.5.2 | Microsoft XML Schemas | 687 |
15.5.3 | W3C XML Schema | 690 |
15.5.4 | Schema Validation in C# | 691 |
15.6 | Extensible Stylesheet Language and XslTransform | 695 |
15.7 | Microsoft BizTalk™ | 702 |
15.8 | Summary | 705 |
15.9 | Internet and World Wide Web Resources | 707 |
16 | Database, SQL and ADO .NET | 709 |
16.1 | Introduction | 710 |
16.2 | Relational Database Model | 711 |
16.3 | Relational Database Overview: Books Database | 712 |
16.4 | Structured Query Language (SQL) | 719 |
16.4.1 | Basic SELECT Query | 719 |
16.4.2 | WHERE Clause | 720 |
16.4.3 | ORDER BY Clause | 723 |
16.4.4 | Merging Data from Multiple Tables: INNER JOIN | 726 |
16.4.5 | Joining Data from Tables Authors, AuthorISBN, Titles and Publishers | 728 |
16.4.6 | INSERT Statement | 731 |
16.4.7 | UPDATE Statement | 732 |
16.4.8 | DELETE Statement | 733 |
16.5 | ADO .NET Object Model | 734 |
16.6 | Programming with ADO .NET: Extracting Information from a Database | 735 |
16.6.1 | Connecting to and Querying an Access Data Source | 735 |
16.6.2 | Querying the Books Database | 742 |
16.7 | Programming with ADO.NET: Modifying a Database | 744 |
16.8 | Reading and Writing XML Files | 752 |
16.9 | Summary | 755 |
17 | ASP .NET, Web Forms and Web Controls | 757 |
17.1 | Introduction | 758 |
17.2 | Simple HTTP Transaction | 759 |
17.3 | System Architecture | 761 |
17.4 | Creating and Running a Simple Web Form Example | 762 |
17.5 | Web Controls | 775 |
17.5.1 | Text and Graphics Controls | 776 |
17.5.2 | AdRotator Control | 780 |
17.5.3 | Validation Controls | 785 |
17.6 | Session Tracking | 796 |
17.6.1 | Cookies | 797 |
17.6.2 | Session Tracking with HttpSessionState | 806 |
17.7 | Case Study: Online Guest Book | 815 |
17.8 | Case Study: Connecting to a Database in ASP .NET | 822 |
17.9 | Tracing | 836 |
17.10 | Summary | 838 |
17.11 | Internet and Web Resources | 840 |
18 | ASP .NET and Web Services | 842 |
18.1 | Introduction | 843 |
18.2 | Web Services | 844 |
18.3 | Simple Object Access Protocol (SOAP) and Web Services | 847 |
18.4 | Publishing and Consuming Web Services | 849 |
18.5 | Session Tracking in Web Services | 864 |
18.6 | Using Web Forms and Web Services | 877 |
18.7 | Case Study: Temperature Information Application | 883 |
18.8 | User-Defined Types in Web Services | 893 |
18.9 | Summary | 903 |
19 | Networking: Streams-Based Sockets and Datagrams | 905 |
19.1 | Introduction | 906 |
19.2 | Establishing a Simple Server (Using Stream Sockets) | 907 |
19.3 | Establishing a Simple Client (Using Stream Sockets) | 909 |
19.4 | Client/Server Interaction with Stream-Socket Connections | 910 |
19.5 | Connectionless Client/Server Interaction with Datagrams | 919 |
19.6 | Client/Server Tic-Tac-Toe Using a Multithreaded Server | 924 |
19.7 | Summary | 939 |
20 | Data Structures and Collections | 941 |
20.1 | Introduction | 942 |
20.2 | Self-Referential Classes | 942 |
20.3 | Linked Lists | 944 |
20.4 | Stacks | 956 |
20.5 | Queues | 961 |
20.6 | Trees | 964 |
20.6.1 | Binary Search Tree of Integer Values | 966 |
20.6.2 | Binary Search Tree of IComparable Objects | 973 |
20.7 | Collection Classes | 981 |
20.7.1 | Class Array | 981 |
20.7.2 | Class ArrayList | 984 |
20.7.3 | Class Stack | 990 |
20.7.4 | Class Hashtable | 994 |
20.8 | Summary | 1000 |
21 | Accessibility | 1002 |
21.1 | Introduction | 1003 |
21.2 | Regulations and Resources | 1004 |
21.3 | Web Accessibility Initiative | 1006 |
21.4 | Providing Alternatives for Images | 1006 |
21.5 | Maximizing Readability by Focusing on Structure | 1008 |
21.6 | Accessibility in Visual Studio .NET | 1008 |
21.6.1 | Enlarging Toolbar Icons | 1009 |
21.6.2 | Enlarging the Text | 1010 |
21.6.3 | Modifying the Toolbox | 1011 |
21.6.4 | Modifying the Keyboard | 1011 |
21.6.5 | Rearranging Windows | 1012 |
21.7 | Accessibility in C# | 1014 |
21.8 | Accessibility in XHTML Tables | 1020 |
21.9 | Accessibility in XHTML Frames | 1024 |
21.10 | Accessibility in XML | 1025 |
21.11 | Using Voice Synthesis and Recognition with VoiceXML™ | 1025 |
21.12 | CallXML™ | 1033 |
21.13 | JAWS® for Windows | 1038 |
21.14 | Other Accessibility Tools | 1039 |
21.15 | Accessibility in Microsoft® Windows® 2000 | 1041 |
21.15.1 | Tools for People with Visual Impairments | 1042 |
21.15.2 | Tools for People with Hearing Impairments | 1044 |
21.15.3 | Tools for Users Who Have Difficulty Using the Keyboard | 1045 |
21.15.4 | Microsoft Narrator | 1048 |
21.15.5 | Microsoft On-Screen Keyboard | 1051 |
21.15.6 | Accessibility Features in Microsoft Internet Explorer 6.0 | 1052 |
21.16 | Summary | 1053 |
21.17 | Internet and Web Resources | 1054 |
22 | Mobile Internet Toolkit | 1057 |
22.1 | Introduction | 1058 |
22.2 | Mobile Internet Toolkit Client Devices | 1058 |
22.3 | Introduction to the Mobile Internet Toolkit and Mobile Web Forms | 1060 |
22.4 | Advanced Mobile Web Forms Controls | 1075 |
22.5 | Example: Deitel Wireless Portal | 1083 |
22.6 | Device-Independent Web Design Using Style Sheets and Templates | 1088 |
22.7 | Consuming a Web Service from a Mobile Application | 1101 |
22.8 | Summary | 1107 |
22.9 | Internet and World Wide Web Resources | 1108 |
A | Operator Precedence Chart | 1109 |
B | Number Systems | 1111 |
B.1 | Introduction | 1112 |
B.2 | Abbreviating Binary Numbers as Octal Numbers and Hexadecimal Numbers | |
B.3 | Converting Octal Numbers and Hexadecimal Numbers to Binary Numbers | 1117 |
B.4 | Converting from Binary, Octal or Hexadecimal to Decimal | 1117 |
B.5 | Converting from Decimal to Binary, Octal or Hexadecimal | 1118 |
B.6 | Negative Binary Numbers: Two’s Complement Notation | 1119 |
B.7 | Summary | 1120 |
C | Career Opportunities | 1122 |
C.1 | Introduction | 1123 |
C.2 | Resources for the Job Seeker | 1124 |
C.3 | Online Opportunities for Employers | 1125 |
C.3.1 | Posting Jobs Online | 1127 |
C.3.2 | Problems with Recruiting on the Web | 1129 |
C.3.3 | Diversity in the Workplace | 1129 |
C.4 | Recruiting Services | 1130 |
C.5 | Career Sites | 1131 |
C.5.1 | Comprehensive Career Sites | 1131 |
C.5.2 | Technical Positions | 1132 |
C.5.3 | Wireless Positions | 1132 |
C.5.4 | Contracting Online | 1133 |
C.5.5 | Executive Positions | 1134 |
C.5.6 | Students and Young Professionals | 1135 |
C.5.7 | Other Online Career Services | 1135 |
C.6 | Summary | 1136 |
C.7 | Internet and World Wide Web Resources | 1137 |
D | Visual Studio .NET Debugger | 1142 |
D.1 | Introduction | 1143 |
D.2 | Breakpoints | 1144 |
D.3 | Examining Data | 1146 |
D.4 | Program Control | 1149 |
D.5 | Additional Method Debugging Capabilities | 1153 |
D.6 | Additional Class Debugging Capabilities | 1155 |
D.7 | Summary | 1158 |
E | Generating Documentation in Visual Studio .NET | 1160 |
E.1 | Introduction | 1161 |
E.2 | Documentation Comments | 1161 |
E.3 | Documenting C# Source Code | 1162 |
E.4 | Creating Comment Web Pages | 1170 |
E.5 | Creating XML Documentation Files | 1172 |
E.6 | Summary | 1177 |
F | ASCII Character Set | 1179 |
G | Unicode® | 1180 |
G.1 | Introduction | 1181 |
G.2 | Unicode Transformation Formats | 1182 |
G.3 | Characters and Glyphs | 1183 |
G.4 | Advantages and Disadvantages of Unicode | 1184 |
G.5 | Unicode Consortium’s Web Site | 1184 |
G.6 | Using Unicode | 1185 |
G.7 | Character Ranges | 1188 |
G.8 | Summary | 1189 |
H | COM Integration | 1191 |
H.1 | Introduction | 1191 |
H.2 | ActiveX Integration | 1192 |
H.3 | DLL Integration | 1196 |
H.4 | Summary | 1200 |
H.5 | Internet and World Wide Web Resources | 1201 |
I | Introduction to HyperText Markup Language 4: Part 1 | 1202 |
I.1 | Introduction | 1203 |
I.2 | Markup Languages | 1203 |
I.3 | Editing HTML | 1204 |
I.4 | Common Elements | 1204 |
I.5 | Headers | 1207 |
I.6 | Linking | 1208 |
I.7 | Images | 1210 |
I.8 | Special Characters and More Line Breaks | 1214 |
I.9 | Unordered Lists | 1216 |
I.10 | Nested and Ordered Lists | 1217 |
I.11 | Summary | 1220 |
I.12 | Internet and World Wide Web Resources | 1221 |
J | Introduction to HyperText Markup Language 4: Part 2 | 1222 |
J.1 | Introduction | 1223 |
J.2 | Basic HTML Tables | 1223 |
J.3 | Intermediate HTML Tables and Formatting | 1225 |
J.4 | Basic HTML Forms | 1228 |
J.5 | More Complex HTML Forms | 1231 |
J.6 | Internal Linking | 1238 |
J.7 | Creating and Using Image Maps | 1241 |
J.8 | <meta> Tags | 1243 |
J.9 | frameset Element | 1245 |
J.10 | Nested framesets | 1247 |
J.11 | Summary | 1249 |
J.12 | Internet and World Wide Web Resources | 1251 |
K | Introduction to XHTML: Part 1 | 1252 |
K.1 | Introduction | 1253 |
K.2 | Editing XHTML | 1253 |
K.3 | First XHTML Example | 1254 |
K.4 | W3C XHTML Validation Service | 1257 |
K.5 | Headers | 1258 |
K.6 | Linking | 1260 |
K.7 | Images | 1263 |
K.8 | Special Characters and More Line Breaks | 1267 |
K.9 | Unordered Lists | 1269 |
K.10 | Nested and Ordered Lists | 1270 |
K.11 | Summary | 1273 |
K.12 | Internet and World Wide Web Resources | 1274 |
L | Introduction to XHTML: Part 2 | 1275 |
L.1 | Introduction | 1276 |
L.2 | Basic XHTML Tables | 1276 |
L.3 | Intermediate XHTML Tables and Formatting | 1279 |
L.4 | Basic XHTML Forms | 1281 |
L.5 | More Complex XHTML Forms | 1284 |
L.6 | Internal Linking | 1292 |
L.7 | Creating and Using Image Maps | 1295 |
L.8 | meta Elements | 1297 |
L.9 | frameset Element | 1298 |
L.10 | Nested framesets | 1302 |
L.11 | Summary | 1304 |
L.12 | Internet and World Wide Web Resources | 1305 |
M | HTML/XHTML Special Characters | 1307 |
N | HTML/XHTML Colors | 1308 |
O | Bit Manipulation | 1311 |
O.1 | Introduction | 1312 |
O.2 | Bit Manipulation and the Bitwise Operators | 1312 |
O.3 | Class BitArray | 1324 |
O.4 | Summary | 1327 |
P | Crystal Reports® for Visual Studio .NET | 1328 |
P.1 | Introduction | 1328 |
P.2 | Crystal Reports Web Site Resources | 1328 |
P.3 | Crystal Reports and Visual Studio .NET | 1329 |
P.3.1 | Crystal Reports in Web Applications | 1332 |
P.3.2 | Crystal Reports and Web Services | 1332 |
| | Bibliography | 1334 |
| | Index | 1338 |
© 1992-2005. Deitel & Associates, Inc. All Rights Reserved. |