Contents. 1 Introduction to Computers, Internet and Visual Basic.NET 1

vbhtp2TOC.fm Page vii Friday, December 14, 2001 1:46 PM Contents Contents vii Illustrations Preface xxviii xxxvii 1 Introduction to Computers, I...
Author: Naomi Thomas
4 downloads 0 Views 214KB Size
vbhtp2TOC.fm Page vii Friday, December 14, 2001 1:46 PM

Contents

Contents

vii

Illustrations Preface

xxviii xxxvii

1 Introduction to Computers, Internet and Visual Basic .NET 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19

Introduction What Is a Computer? Computer Organization Evolution of Operating Systems Personal Computing, Distributed Computing and Client/Server Computing Machine Languages, Assembly Languages and High-Level Languages Visual Basic .NET C, C++, Java™ and C# Other High-Level Languages Structured Programming Key Software Trend: Object Technology Hardware Trends History of the Internet and World Wide Web World Wide Web Consortium (W3C) Extensible Markup Language (XML) Introduction to Microsoft .NET .NET Framework and the Common Language Runtime Tour of the Book Internet and World Wide Web Resources © Copyright 2001 by Prentice Hall. All Rights Reserved.

1 2 3 4 5 5 6 7 9 10 10 11 13 14 15 16 17 18 20 29

vbhtp2TOC.fm Page viii Friday, December 14, 2001 1:46 PM

Contents

VIII

2

Introduction to the Visual Studio .NET IDE

2.1 2.2 2.3 2.4

2.5 2.6 2.7

Introduction Overview of the Visual Studio .NET IDE Menu Bar and Toolbar Visual Studio .NET IDE Windows 2.4.1 Solution Explorer 2.4.2 Toolbox 2.4.3 Properties Window Using Help Simple Program: Displaying Text and an Image Internet and World Wide Web Resources

3

Introduction to Visual Basic Programming

3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8

Introduction Simple Program: Printing a Line of Text Another Simple Program: Adding Integers Memory Concepts Arithmetic Decision Making: Equality and Relational Operators Using a Dialog to Display a Message Internet and World Wide Web Resources

4

Control Structures: Part 1

96

4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10 4.11 4.12

97 97 98 98 102 104 106 108 109 110 112

4.15

Introduction Algorithms Pseudocode Control Structures If/Then Selection Structure If/Then/Else Selection Structure While Repetition Structure Do While/Loop Repetition Structure Do Until/Loop Repetition Structure Assignment Operators Formulating Algorithms: Case Study 1 (Counter-Controlled Repetition) Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 2 (Sentinel-Controlled Repetition) Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 3 (Nested Control Structures) Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 4 (Nested Repetition Structures) Introduction to Windows Application Programming

5

Control Structures: Part 2

5.1 5.2 5.3 5.4

Introduction Essentials of Counter-Controlled Repetition For/Next Repetition Structure Examples Using the For/Next Structure

4.13 4.14

© Copyright 2001 by Prentice Hall. All Rights Reserved.

33 34 34 37 39 40 41 41 44 45 55

61 62 62 70 73 74 78 82 88

114 119 123 127

144 145 145 146 149

vbhtp2TOC.fm Page ix Friday, December 14, 2001 1:46 PM

Contents

IX

5.5 5.6 5.7 5.8 5.9 5.10

Select Case Multiple-Selection Structure Do/Loop While Repetition Structure Do/Loop Until Repetition Structure Using the Exit Keyword in a Repetition Structure Logical Operators Structured Programming Summary

6

Procedures

6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 6.10 6.11 6.12 6.13 6.14 6.15 6.16 6.17

6.18

Introduction Modules, Classes and Procedures Sub Procedures Function Procedures Methods Argument Promotion Option Strict and Data-Type Conversions Value Types and Reference Types Passing Arguments: Pass-by-Value vs. Pass-by-Reference Duration of Identifiers Scope Rules Random-Number Generation Example: Game of Chance Recursion Example Using Recursion: Fibonacci Series Recursion vs. Iteration Procedure Overloading and Optional Arguments 6.17.1 Procedure Overloading 6.17.2 Optional Arguments Modules

7

Arrays

7.1 7.2 7.3 7.4

Introduction Arrays Declaring and Allocating Arrays Examples Using Arrays 7.4.1 Allocating an Array 7.4.2 Initializing the Values in an Array 7.4.3 Summing the Elements of an Array 7.4.4 Using Arrays to Analyze Survey Results 7.4.5 Using Histograms to Display Array Data Graphically Passing Arrays to Procedures Passing Arrays: ByVal vs. ByRef Sorting Arrays Searching Arrays: Linear Search and Binary Search 7.8.1 Searching an Array with Linear Search 7.8.2 Searching a Sorted Array with Binary Search Multidimensional Rectangular and Jagged Arrays

7.5 7.6 7.7 7.8

7.9

155 159 160 162 164 170

182 183 183 185 188 190 195 196 198 200 202 203 206 213 218 221 225 226 226 228 231

245

© Copyright 2001 by Prentice Hall. All Rights Reserved.

246 246 248 249 250 251 252 253 256 260 264 268 272 272 275 279

vbhtp2TOC.fm Page x Friday, December 14, 2001 1:46 PM

Contents

X

7.10 7.11

Variable-Length Parameter Lists For Each/Next Repetition Structure

8

Object-Based Programming

8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 8.10 8.11 8.12 8.13 8.14 8.15 8.16

Introduction Implementing a Time Abstract Data Type with a Class Class Scope Controlling Access to Members Initializing Class Objects: Constructors Using Overloaded Constructors Properties Composition: Objects as Instance Variables of Other Classes Using the Me Reference Garbage Collection Shared Class Members Const and ReadOnly Members Data Abstraction and Information Hiding Software Reusability Namespaces and Assemblies Class View and Object Browser

9

Object-Oriented Programming: Inheritance

9.1 9.2 9.3 9.4 9.5 9.6 9.7

Introduction Base Classes and Derived Classes Protected and Friend Members Relationship between Base Classes and Derived Classes Case Study: Three-Level Inheritance Hierarchy Constructors and Finalizers in Derived Classes Software Engineering with Inheritance

10

Object-Oriented Programming: Polymorphism

10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 10.10

Introduction Derived-Class-Object to Base-Class-Object Conversion Type Fields and Select Case Statements Polymorphism Examples Abstract Classes and Methods Case Study: Inheriting Interface and Implementation NotInheritable Classes and NotOverridable Methods Case Study: Payroll System Using Polymorphism Case Study: Creating and Using Interfaces Delegates

11

Exception Handling

11.1 11.2 11.3 11.4

Introduction Exception Handling Overview Example: DivideByZeroException .NET Exception Hierarchy © Copyright 2001 by Prentice Hall. All Rights Reserved.

287 288

296 297 298 306 306 308 308 314 321 324 326 327 331 334 335 336 340

349 350 351 354 354 372 376 382

388 389 389 396 397 398 400 408 409 419 432

441 442 443 446 450

vbhtp2TOC.fm Page xi Friday, December 14, 2001 1:46 PM

Contents

XI

11.5 11.6 11.7 11.8

Finally Block Exception Properties Programmer-Defined Exception Classes Handling Overflows

12

Graphical User Interface Concepts: Part 1

12.1 12.2 12.3 12.4 12.5 12.6 12.7 12.8 12.9 12.10

Introduction Windows Forms Event-Handling Model Control Properties and Layout Labels, TextBoxes and Buttons GroupBoxes and Panels CheckBoxes and RadioButtons PictureBoxes Mouse-Event Handling Keyboard-Event Handling

13

Graphical User Interface Concepts: Part 2

13.1 13.2 13.3 13.4

Introduction Menus LinkLabels ListBoxes and CheckedListBoxes 13.4.1 ListBoxes 13.4.2 CheckedListBoxes 13.5 ComboBoxes 13.6 TreeViews 13.7 ListViews 13.8 Tab Control 13.9 Multiple-Document-Interface (MDI) Windows 13.10 Visual Inheritance 13.11 User-Defined Controls

14

Multithreading

14.1 14.2 14.3 14.4 14.5 14.6 14.7

Introduction Thread States: Life Cycle of a Thread Thread Priorities and Thread Scheduling Thread Synchronization and Class Monitor Producer/Consumer Relationship without Thread Synchronization Producer/Consumer Relationship with Thread Synchronization Producer/Consumer Relationship: Circular Buffer

15

Strings, Characters and Regular Expressions

15.1 15.2 15.3 15.4 15.5

Introduction Fundamentals of Characters and Strings String Constructors String Length and Chars Properties, and CopyTo Method Comparing Strings © Copyright 2001 by Prentice Hall. All Rights Reserved.

452 459 464 468

475 476 478 480 487 491 494 497 508 510 513

523 524 524 534 538 540 542 545 550 555 562 567 576 580

592 593 595 596 601 603 609 618

633 634 634 635 637 639

vbhtp2TOC.fm Page xii Friday, December 14, 2001 1:46 PM

Contents

XII

15.6 15.7 15.8 15.9 15.10 15.11 15.12 15.13 15.14 15.15 15.16 15.17

String Method GetHashCode Locating Characters and Substrings in Strings Extracting Substrings from Strings Concatenating Strings Miscellaneous String Methods Class StringBuilder StringBuilder Indexer, Length and Capacity Properties, and EnsureCapacity Method StringBuilder Append and AppendFormat Methods StringBuilder Insert, Remove and Replace Methods Char Methods Card Shuffling and Dealing Simulation Regular Expressions and Class Regex

16

Graphics and Multimedia

16.1 16.2 16.3 16.4 16.5 16.6 16.7 16.8 16.9 16.10 16.11 16.12 16.13

Introduction Graphics Contexts and Graphics Objects Color Control Font Control Drawing Lines, Rectangles and Ovals Drawing Arcs Drawing Polygons and Polylines Advanced Graphics Capabilities Introduction to Multimedia Loading, Displaying and Scaling Images Animating a Series of Images Windows Media Player Microsoft Agent

17

Files and Streams

17.1 17.2 17.3 17.4 17.5 17.6 17.7 17.8 17.9 17.10 17.11

Introduction Data Hierarchy Files and Streams Classes File and Directory Creating a Sequential-Access File Reading Data from a Sequential-Access File Random-Access Files Creating a Random-Access File Writing Data Randomly to a Random-Access File Reading Data Sequentially from a Random-Access File Case Study: A Transaction-Processing Program

18

Extensible Markup Language (XML)

18.1 18.2 18.3 18.4

Introduction XML Documents XML Namespaces Document Object Model (DOM) © Copyright 2001 by Prentice Hall. All Rights Reserved.

643 644 647 648 649 651 652 654 657 660 663 667

683 684 686 687 694 699 702 705 709 714 714 716 729 731

752 753 753 755 757 767 778 789 794 797 802 807

833 834 834 839 842

vbhtp2TOC.fm Page xiii Friday, December 14, 2001 1:46 PM

Contents

18.5

XIII

18.6 18.7 18.8

Document Type Definitions (DTDs), Schemas and Validation 18.5.1 Document Type Definitions 18.5.2 Microsoft XML Schemas Extensible Stylesheet Language and XslTransform Microsoft BizTalk™ Internet and World Wide Web Resources

19

Database, SQL and ADO .NET

19.1 19.2 19.3 19.4

19.7 19.8

Introduction Relational Database Model Relational Database Overview: Books Database Structured Query Language (SQL) 19.4.1 Basic SELECT Query 19.4.2 WHERE Clause 19.4.3 ORDER BY Clause 19.4.4 Merging Data from Multiple Tables: INNER JOIN 19.4.5 Joining Data from Tables Authors, AuthorISBN, Titles and Publishers 19.4.6 INSERT Statement 19.4.7 UPDATE Statement 19.4.8 DELETE Statement ADO .NET Object Model Programming with ADO .NET: Extracting Information from a DBMS 19.6.1 Connecting to and Querying an Access Data Source 19.6.2 Querying the Books Database Programming with ADO .NET: Modifying a DBMS Reading and Writing XML Files

20

ASP .NET, Web Forms and Web Controls

19.5 19.6

20.1 20.2 20.3 20.4 20.5

Introduction Simple HTTP Transaction System Architecture Creating and Running a Simple Web-Form Example Web Controls 20.5.1 Text and Graphics Controls 20.5.2 AdRotator Control 20.5.3 Validation Controls 20.6 Session Tracking 20.6.1 Cookies 20.6.2 Session Tracking with HttpSessionState 20.7 Case Study: Online Guest book 20.8 Case Study: Connecting to a Database in ASP .NET 20.9 Tracing 20.10 Internet and World Wide Web Resources

21

ASP .NET and Web Services

21.1

Introduction © Copyright 2001 by Prentice Hall. All Rights Reserved.

860 861 865 870 877 880

887 888 889 890 896 897 898 901 903 906 909 910 911 912 913 913 921 923 932

941 942 943 945 946 958 958 964 969 979 980 989 998 1004 1019 1021

1030 1031

vbhtp2TOC.fm Page xiv Friday, December 14, 2001 1:46 PM

Contents

XIV

21.2 21.3 21.4 21.5 21.6 21.7 21.8 21.9

Web Services Simple Object Access Protocol (SOAP) and Web Services Publishing and Consuming Web Services Session Tracking in Web Services Using Web Forms and Web Services Case Study: Temperature Information Application User-Defined Types in Web Services Internet and World Wide Web Resources

22 Networking: Streams-Based Sockets and Datagrams 22.1 22.2 22.3 22.4 22.5 22.6

Introduction Establishing a Simple Server (Using Stream Sockets) Establishing a Simple Client (Using Stream Sockets) Client/Server Interaction via Stream-Socket Connections Connectionless Client/Server Interaction via Datagrams Client/Server Tic-Tac-Toe Using a Multithreaded Server

23

Data Structures and Collections

23.1 23.2 23.3 23.4 23.5 23.6

Introduction Self-Referential Classes Linked Lists Stacks Queues Trees 23.6.1 Binary Search Tree of Integer Values 23.6.2 Binary Search Tree of IComparable Objects Collection Classes 23.7.1 Class Array 23.7.2 Class ArrayList 23.7.3 Class Stack 23.7.4 Class Hashtable

23.7

24

Accessibility

24.1 24.2 24.3 24.4 24.5 24.6

Introduction Regulations and Resources Web Accessibility Initiative Providing Alternatives for Images Maximizing Readability by Focusing on Structure Accessibility in Visual Studio .NET 24.6.1 Enlarging Toolbar Icons 24.6.2 Enlarging the Text 24.6.3 Modifying the Toolbox 24.6.4 Modifying the Keyboard 24.6.5 Rearranging Windows Accessibility in Visual Basic Accessibility in XHTML Tables

24.7 24.8

© Copyright 2001 by Prentice Hall. All Rights Reserved.

1032 1036 1037 1053 1066 1072 1081 1091

1096 1097 1098 1100 1101 1110 1116

1136 1137 1137 1139 1152 1156 1160 1161 1168 1175 1176 1179 1185 1189

1203 1204 1205 1207 1208 1209 1209 1210 1211 1212 1213 1214 1215 1221

vbhtp2TOC.fm Page xv Friday, December 14, 2001 1:46 PM

Contents

XV

24.9 24.10 24.11 24.12 24.13 24.14 24.15

Accessibility in XHTML Frames Accessibility in XML Using Voice Synthesis and Recognition with VoiceXML™ CallXML™ JAWS® for Windows Other Accessibility Tools Accessibility in Microsoft® Windows® 2000 24.15.1 Tools for People with Visual Impairments 24.15.2 Tools for People with Hearing Impairments 24.15.3 Tools for Users Who Have Difficulty Using the Keyboard 24.15.4 Microsoft Narrator 24.15.5 Microsoft On-Screen Keyboard 24.15.6 Accessibility Features in Microsoft Internet Explorer 5.5 24.16 Internet and World Wide Web Resources

A

1225 1226 1226 1233 1240 1240 1241 1243 1246 1247 1251 1252 1253 1255

Operator Precedence Chart

1264

B

Number Systems (on CD)

1266

B.1 B.2 B.3 B.4 B.5 B.6

Introduction 1267 Abbreviating Binary Numbers as Octal Numbers and Hexadecimal Numbers 1270 Converting Octal Numbers and Hexadecimal Numbers to Binary Numbers 1272 Converting from Binary, Octal or Hexadecimal to Decimal 1272 Converting from Decimal to Binary, Octal or Hexadecimal 1273 Negative Binary Numbers: Two’s Complement Notation 1274

C

Career Opportunities (on CD)

C.1 C.2 C.3

C.6

Introduction Resources for the Job Seeker Online Opportunities for Employers C.3.1 Posting Jobs Online C.3.2 Problems with Recruiting on the Web C.3.3 Diversity in the Workplace Recruiting Services Career Sites C.5.1 Comprehensive Career Sites C.5.2 Technical Positions C.5.3 Wireless Positions C.5.4 Contracting Online C.5.5 Executive Positions C.5.6 Students and Young Professionals C.5.7 Other Online Career Services Internet and World Wide Web Resources

D

Visual Studio .NET Debugger

D.1 D.2 D.3

Introduction Breakpoints Examining Data

C.4 C.5

© Copyright 2001 by Prentice Hall. All Rights Reserved.

1280 1281 1282 1283 1285 1287 1287 1288 1289 1289 1290 1290 1291 1292 1293 1293 1294

1302 1303 1304 1306

vbhtp2TOC.fm Page xvi Friday, December 14, 2001 1:46 PM

Contents

XVI

D.4 D.5 D.6

Program Control Additional Procedure Debugging Capabilities Additional Class Debugging Capabilities

E

ASCII Character Set

1319

F

Unicode® (on CD)

1320

F.1 F.2 F.3 F.4 F.5 F.6 F.7

Introduction Unicode Transformation Formats Characters and Glyphs Advantages/Disadvantages of Unicode Unicode Consortium’s Web Site Using Unicode Character Ranges

G

COM Integration (on CD)

G.1 G.2 G.3 G.4

Introduction ActiveX Integration DLL Integration Internet and World Wide Web Resources

H Introduction to HyperText Markup Language 4: Part 1 (on CD) H.1 H.2 H.3 H.4 H.5 H.6 H.7 H.8 H.9 H.10 H.11

Introduction Markup Languages Editing HTML Common Elements Headers Linking Images Special Characters and More Line Breaks Unordered Lists Nested and Ordered Lists Internet and World Wide Web Resources

I Introduction to HyperText Markup Language 4: Part 2 (on CD) I.1 I.2 I.3 I.4 I.5 I.6 I.7 I.8 I.9

Introduction Basic HTML Tables Intermediate HTML Tables and Formatting Basic HTML Forms More Complex HTML Forms Internal Linking Creating and Using Image Maps Tags frameset Element © Copyright 2001 by Prentice Hall. All Rights Reserved.

1308 1312 1314

1321 1322 1323 1324 1324 1325 1327

1332 1332 1333 1337 1341

1344 1345 1345 1346 1346 1349 1350 1352 1356 1358 1359 1362

1367 1368 1368 1370 1373 1376 1383 1386 1388 1390

vbhtp2TOC.fm Page xvii Friday, December 14, 2001 1:46 PM

Contents

I.10 I.11

XVII

Nested framesets Internet and World Wide Web Resources

1392 1394

J

Introduction to XHTML: Part 1 (on CD)

J.1 J.2 J.3 J.4 J.5 J.6 J.7 J.8 J.9 J.10 J.11

Introduction Editing XHTML First XHTML Example W3C XHTML Validation Service Headers Linking Images Special Characters and More Line Breaks Unordered Lists Nested and Ordered Lists Internet and World Wide Web Resources

1400

K

Introduction to XHTML: Part 2 (on CD)

K.1 K.2 K.3 K.4 K.5 K.6 K.7 K.8 K.9 K.10 K.11

Introduction Basic XHTML Tables Intermediate XHTML Tables and Formatting Basic XHTML Forms More Complex XHTML Forms Internal Linking Creating and Using Image Maps meta Elements frameset Element Nested framesets Internet and World Wide Web Resources

L

HTML/XHTML Special Characters

1462

M

HTML/XHTML Colors

1463

N

Crystal Reports® for Visual Studio .NET

1466

N.1 N.2 N.3

Introduction Crystal Reports Web Site Resources Crystal Reports and Visual Studio .NET N.3.1 Crystal Reports in Web Applications N.3.2 Crystal Reports and Web Services

1401 1401 1402 1405 1406 1408 1411 1415 1417 1418 1421

1426 1427 1427 1430 1432 1435 1443 1446 1448 1449 1454 1456

1466 1466 1467 1469 1469

Bibliography

1471

Index

1475

© Copyright 2001 by Prentice Hall. All Rights Reserved.